summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-07-17 05:00:52 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-07-17 05:00:52 (GMT)
commitdb5860b7c71e4f65f347464933b6dacc303b3a74 (patch)
tree04b71c76f2a79e03a2d3eaea6406e018a4483957 /Python
parent8ff9f9f4aa8b26bcc7ace687f796b7cddb9a659b (diff)
downloadcpython-db5860b7c71e4f65f347464933b6dacc303b3a74.zip
cpython-db5860b7c71e4f65f347464933b6dacc303b3a74.tar.gz
cpython-db5860b7c71e4f65f347464933b6dacc303b3a74.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index ca8dd26..5549e9f 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: