gh-107265: Ensure de_instrument does not handle ENTER_EXECUTOR (#108366)

This commit is contained in:
Dong-hee Na 2023-08-24 00:45:20 +09:00 committed by GitHub
parent 3f61cf646d
commit 2135bcd3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -564,6 +564,7 @@ de_instrument(PyCodeObject *code, int i, int event)
_Py_CODEUNIT *instr = &_PyCode_CODE(code)[i]; _Py_CODEUNIT *instr = &_PyCode_CODE(code)[i];
uint8_t *opcode_ptr = &instr->op.code; uint8_t *opcode_ptr = &instr->op.code;
int opcode = *opcode_ptr; int opcode = *opcode_ptr;
assert(opcode != ENTER_EXECUTOR);
if (opcode == INSTRUMENTED_LINE) { if (opcode == INSTRUMENTED_LINE) {
opcode_ptr = &code->_co_monitoring->lines[i].original_opcode; opcode_ptr = &code->_co_monitoring->lines[i].original_opcode;
opcode = *opcode_ptr; opcode = *opcode_ptr;