[pypy-svn] r66496 - pypy/branch/parser-compiler/pypy/interpreter/astcompiler
benjamin at codespeak.net
benjamin at codespeak.net
Wed Jul 22 03:37:45 CEST 2009
Author: benjamin
Date: Wed Jul 22 03:37:44 2009
New Revision: 66496
Modified:
pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py
Log:
set lineno again for iter in for and while loops
Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py (original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py Wed Jul 22 03:37:44 2009
@@ -431,6 +431,8 @@
fr.iter.walkabout(self)
self.emit_op(ops.GET_ITER)
self.use_next_block(start)
+ # This adds another line, so each for iteration can be traced.
+ self.lineno_set = False
self.emit_jump(ops.FOR_ITER, cleanup)
fr.target.walkabout(self)
self.visit_sequence(fr.body)
@@ -458,6 +460,8 @@
self.push_frame_block(F_BLOCK_LOOP, loop)
self.use_next_block(loop)
if test_constant == misc.CONST_NOT_CONST:
+ # Force another lineno to be set for tracing purposes.
+ self.lineno_set = False
wh.test.walkabout(self)
self.emit_jump(ops.JUMP_IF_FALSE, anchor)
self.emit_op(ops.POP_TOP)
More information about the Pypy-commit
mailing list