mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-109371: Fix monitoring with instruction events set (gh-109385)
This commit is contained in:
parent
23f9f6f464
commit
412f5e85d6
4 changed files with 33 additions and 2 deletions
|
@ -664,7 +664,7 @@ instrument(PyCodeObject *code, int i)
|
|||
if (opcode == INSTRUMENTED_INSTRUCTION) {
|
||||
opcode_ptr = &code->_co_monitoring->per_instruction_opcodes[i];
|
||||
opcode = *opcode_ptr;
|
||||
CHECK(!is_instrumented(opcode));
|
||||
CHECK(opcode != INSTRUMENTED_INSTRUCTION && opcode != INSTRUMENTED_LINE);
|
||||
CHECK(opcode == _PyOpcode_Deopt[opcode]);
|
||||
}
|
||||
CHECK(opcode != 0);
|
||||
|
@ -1295,6 +1295,9 @@ initialize_tools(PyCodeObject *code)
|
|||
if (opcode == INSTRUMENTED_LINE) {
|
||||
opcode = code->_co_monitoring->lines[i].original_opcode;
|
||||
}
|
||||
if (opcode == INSTRUMENTED_INSTRUCTION) {
|
||||
opcode = code->_co_monitoring->per_instruction_opcodes[i];
|
||||
}
|
||||
bool instrumented = is_instrumented(opcode);
|
||||
if (instrumented) {
|
||||
opcode = DE_INSTRUMENT[opcode];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue