summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 32b485e..2a0f268 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -2493,19 +2493,21 @@
next_instr += 1;
INSTRUCTION_STATS(ENTER_EXECUTOR);
#ifdef _Py_TIER2
- int prevoparg = oparg;
- CHECK_EVAL_BREAKER();
- if (this_instr->op.code != ENTER_EXECUTOR ||
- this_instr->op.arg != prevoparg) {
- next_instr = this_instr;
- DISPATCH();
- }
PyCodeObject *code = _PyFrame_GetCode(frame);
_PyExecutorObject *executor = code->co_executors->executors[oparg & 255];
assert(executor->vm_data.index == INSTR_OFFSET() - 1);
assert(executor->vm_data.code == code);
assert(executor->vm_data.valid);
assert(tstate->previous_executor == NULL);
+ /* If the eval breaker is set then stay in tier 1.
+ * This avoids any potentially infinite loops
+ * involving _RESUME_CHECK */
+ if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) {
+ opcode = executor->vm_data.opcode;
+ oparg = (oparg & ~255) | executor->vm_data.oparg;
+ next_instr = this_instr;
+ DISPATCH_GOTO();
+ }
tstate->previous_executor = Py_None;
Py_INCREF(executor);
GOTO_TIER_TWO(executor);