mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
[3.13] gh-122247: Move instruction instrumentation sanity check after tracing check (GH-122251) (GH-122812)
(cherry picked from commit 57d7c3e78f
)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
This commit is contained in:
parent
7ee7558833
commit
1f7071572e
2 changed files with 16 additions and 1 deletions
|
@ -1344,7 +1344,6 @@ int
|
|||
_Py_call_instrumentation_instruction(PyThreadState *tstate, _PyInterpreterFrame* frame, _Py_CODEUNIT *instr)
|
||||
{
|
||||
PyCodeObject *code = _PyFrame_GetCode(frame);
|
||||
assert(debug_check_sanity(tstate->interp, code));
|
||||
int offset = (int)(instr - _PyCode_CODE(code));
|
||||
_PyCoMonitoringData *instrumentation_data = code->_co_monitoring;
|
||||
assert(instrumentation_data->per_instruction_opcodes);
|
||||
|
@ -1352,6 +1351,7 @@ _Py_call_instrumentation_instruction(PyThreadState *tstate, _PyInterpreterFrame*
|
|||
if (tstate->tracing) {
|
||||
return next_opcode;
|
||||
}
|
||||
assert(debug_check_sanity(tstate->interp, code));
|
||||
PyInterpreterState *interp = tstate->interp;
|
||||
uint8_t tools = instrumentation_data->per_instruction_tools != NULL ?
|
||||
instrumentation_data->per_instruction_tools[offset] :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue