summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@gmail.com>2009-02-28 19:49:43 (GMT)
committerJeffrey Yasskin <jyasskin@gmail.com>2009-02-28 19:49:43 (GMT)
commit4dd40525e6b377fb06643311ce66b06c459a4589 (patch)
tree984291e1d2613bbaaf9c0a803f745b07048df0c4 /Python
parent56420b406d0aa039c1a2476e520990635696136f (diff)
downloadcpython-4dd40525e6b377fb06643311ce66b06c459a4589.zip
cpython-4dd40525e6b377fb06643311ce66b06c459a4589.tar.gz
cpython-4dd40525e6b377fb06643311ce66b06c459a4589.tar.bz2
Fix 2 oversights from r69961.
Diffstat (limited to 'Python')
-rw-r--r--Python/peephole.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/peephole.c b/Python/peephole.c
index c413fc8..de1b2ac 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -425,7 +425,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
cumlc = lastlc + 1;
j = GETARG(codestr, i);
if (codestr[i+3] != POP_JUMP_IF_FALSE ||
- !ISBASICBLOCK(blocks,i,7) ||
+ !ISBASICBLOCK(blocks,i,6) ||
!PyObject_IsTrue(PyList_GET_ITEM(consts, j)))
continue;
memset(codestr+i, NOP, 6);
@@ -516,8 +516,10 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
"if a or b:"
"a and b or c"
"(a and b) and c"
- x:POP_OR_JUMP y y:POP_OR_JUMP z --> x:POP_OR_JUMP z
- x:POP_OR_JUMP y y:JUMP_OR_POP z --> x:POP_JUMP_IF_FALSE y+3
+ x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_FALSE_OR_POP z
+ --> x:JUMP_IF_FALSE_OR_POP z
+ x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_TRUE_OR_POP z
+ --> x:POP_JUMP_IF_FALSE y+3
where y+3 is the instruction following the second test.
*/
case JUMP_IF_FALSE_OR_POP: