Skip to content

Commit

Permalink
Guard _Py_GetExecutor on non-tier-two builds
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Jul 26, 2024
1 parent ba3d68b commit 7c404a8
Showing 1 changed file with 2 additions and 0 deletions.
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);

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
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

0 comments on commit 7c404a8

Please sign in to comment.