We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2a5bba commit 47d56f1Copy full SHA for 47d56f1
Python/optimizer.c
@@ -596,6 +596,14 @@ translate_bytecode_to_trace(
596
// Reserve space for nuops (+ SAVE_IP + EXIT_TRACE)
597
int nuops = expansion->nuops;
598
RESERVE(nuops, 0);
599
+ if (expansion->uops[nuops-1].uop == _POP_FRAME) {
600
+ // Check for trace stack underflow now:
601
+ // We can't bail e.g. in the middle of
602
+ // LOAD_CONST + _POP_FRAME.
603
+ if (trace_stack_depth == 0) {
604
+ DPRINTF(2, "Trace stack underflow\n");
605
+ goto done;}
606
+ }
607
uint32_t orig_oparg = oparg; // For OPARG_TOP/BOTTOM
608
for (int i = 0; i < nuops; i++) {
609
oparg = orig_oparg;
0 commit comments