[pypy-commit] pypy translation-cleanup: Flowspacify dropvaluesuntil()

rlamy noreply at buildbot.pypy.org
Tue Oct 16 15:45:07 CEST 2012


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: translation-cleanup
Changeset: r58128:91340fe60db1
Date: 2012-10-16 11:11 +0100
http://bitbucket.org/pypy/pypy/changeset/91340fe60db1/

Log:	Flowspacify dropvaluesuntil()

diff --git a/pypy/objspace/flow/flowcontext.py b/pypy/objspace/flow/flowcontext.py
--- a/pypy/objspace/flow/flowcontext.py
+++ b/pypy/objspace/flow/flowcontext.py
@@ -261,6 +261,11 @@
         self.valuestackdepth = code.co_nlocals
         self.locals_stack_w = [None] * (code.co_stacksize + code.co_nlocals)
 
+    def dropvaluesuntil(self, finaldepth):
+        for n in range(finaldepth, self.valuestackdepth):
+            self.locals_stack_w[n] = None
+        self.valuestackdepth = finaldepth
+
     def save_locals_stack(self):
         return self.locals_stack_w[:self.valuestackdepth]
 


More information about the pypy-commit mailing list