Skip to content
Prev Previous commit
Next Next commit
Guard _Py_GetExecutor on non-tier-two builds
  • Loading branch information
brandtbucher committed Jul 26, 2024
commit 7c404a8dea42300d90f81602c09058898fc0bcf5
2 changes: 2 additions & 0 deletions Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,14 @@ is_resume(_PyInterpreterFrame *frame, uint8_t *oparg_p)
int offset = frame->instr_ptr - _PyCode_CODE(code);
Comment thread
brandtbucher marked this conversation as resolved.
Outdated
uint8_t opcode = _Py_GetBaseOpcode(code, offset);
uint8_t oparg = frame->instr_ptr->op.arg;
#ifdef _Py_TIER2
if (opcode == ENTER_EXECUTOR) {
_PyExecutorObject *executor = _Py_GetExecutor(code, sizeof(_Py_CODEUNIT) * offset);
opcode = _PyOpcode_Deopt[executor->vm_data.opcode];
oparg = executor->vm_data.oparg;
Py_DECREF(executor);
}
#endif
if (opcode == RESUME) {
*oparg_p = oparg;
return true;
Expand Down