diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-17 05:00:52 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-17 05:00:52 (GMT) |
commit | db5860b7c71e4f65f347464933b6dacc303b3a74 (patch) | |
tree | 04b71c76f2a79e03a2d3eaea6406e018a4483957 | |
parent | 8ff9f9f4aa8b26bcc7ace687f796b7cddb9a659b (diff) | |
download | cpython-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.
-rw-r--r-- | Python/compile.c | 3 |
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: |