Skip to content

Conversation

@gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Sep 7, 2023

_Py_call_instrumentation_line curently tries to get the original opcode before executing the trace function. The opcode can be INSTRUMENT_INSTRUCTION if instruction event is set. However, the trace function/monitoring callbacks can turn off the instruction event inside the function, which would invalidate the orignal opcode.

line_data->original_opcode won't help in this case as it will still store INSTRUMENT_INSTRUCTION - it won't be refreshed. So, in this case, we use the opcode directly if INSTRUCTION event is turned off on the code object entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants