0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 08:20:55 +01:00

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.
This commit is contained in:
Tim Peters 2004-07-17 05:00:52 +00:00
parent 8ff9f9f4aa
commit db5860b7c7

View File

@ -419,7 +419,8 @@ optimize_code(PyObject *code, PyObject* consts, PyObject *names)
continue;
SETARG(codestr, i, (j^1));
codestr[i+3] = NOP;
break;
/* Replace LOAD_GLOBAL/LOAD_NAME None with LOAD_CONST None */
case LOAD_NAME:
case LOAD_GLOBAL: