Skip to content

Commit 430248c

Browse files
committed
fix: pass descriptor to _GUARD_BINARY_OP_EXTEND_{LHS,RHS} in tier2 optimizer
The descriptor pointer was not being passed as an operand when adding _GUARD_BINARY_OP_EXTEND_LHS and _GUARD_BINARY_OP_EXTEND_RHS operations in the tier2 optimizer. This caused the executor to read garbage/NULL values from the inline cache, leading to assertion failures and crashes in JIT-compiled code. Fixed by passing the descriptor as a uintptr_t operand, following the same pattern used for other pointer-valued operations like _CALL_METHOD_DESCRIPTOR_*. Fixes CI failures where multiple test platforms were failing.
1 parent 0b8dfee commit 430248c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/optimizer_bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,11 @@ dummy_func(void) {
455455
ADD_OP(_NOP, 0, 0);
456456
}
457457
else if (lhs_known) {
458-
ADD_OP(_GUARD_BINARY_OP_EXTEND_RHS, 0, 0);
458+
ADD_OP(_GUARD_BINARY_OP_EXTEND_RHS, (uintptr_t)d, 0);
459459
sym_set_type(right, d->rhs_type);
460460
}
461461
else if (rhs_known) {
462-
ADD_OP(_GUARD_BINARY_OP_EXTEND_LHS, 0, 0);
462+
ADD_OP(_GUARD_BINARY_OP_EXTEND_LHS, (uintptr_t)d, 0);
463463
sym_set_type(left, d->lhs_type);
464464
}
465465
}

0 commit comments

Comments
 (0)