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 d811b0f commit c23fef4Copy full SHA for c23fef4
Python/optimizer.c
@@ -389,7 +389,8 @@ translate_bytecode_to_trace(
389
trace_length++;
390
391
int trace_length = 0;
392
- while (trace_length + 2 < max_length) {
+ // ALways reserve space for one uop, plus SET_UP, plus EXIT_TRACE
393
+ while (trace_length + 3 <= max_length) {
394
int opcode = instr->op.code;
395
int oparg = instr->op.arg;
396
switch (opcode) {
@@ -402,6 +403,10 @@ translate_bytecode_to_trace(
402
403
}
404
case LOAD_FAST_LOAD_FAST:
405
{
406
+ // Reserve space for two uops (+ SETUP + EXIT_TRACE)
407
+ if (trace_length + 4 > max_length) {
408
+ goto done;
409
+ }
410
int oparg1 = oparg >> 4;
411
int oparg2 = oparg & 15;
412
ADD_TO_TRACE(LOAD_FAST, oparg1);
0 commit comments