Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db5860b

Browse files
committed
optimize_code(): Repaired gross error in new special-casing for None.
The preceding case statement was missing a terminating "break" stmt, so fell into the new code by mistake. This caused uncaught out-of-bounds accesses to the "names" tuple, leading to a variety of insane behaviors.
1 parent 8ff9f9f commit db5860b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ optimize_code(PyObject *code, PyObject* consts, PyObject *names)
419419
continue;
420420
SETARG(codestr, i, (j^1));
421421
codestr[i+3] = NOP;
422-
422+
break;
423+
423424
/* Replace LOAD_GLOBAL/LOAD_NAME None with LOAD_CONST None */
424425
case LOAD_NAME:
425426
case LOAD_GLOBAL:

0 commit comments

Comments
 (0)