From: Tim Peters Date: Sat, 17 Jul 2004 05:00:52 +0000 (+0000) Subject: optimize_code(): Repaired gross error in new special-casing for None. X-Git-Tag: v2.4a2~227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db5860b7c71e4f65f347464933b6dacc303b3a74;p=python 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. --- diff --git a/Python/compile.c b/Python/compile.c index ca8dd266ff..5549e9f75b 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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: