[pypy-svn] r53589 - in pypy/branch/jit-hotpath/pypy/jit/codegen: ia32 test
arigo at codespeak.net
arigo at codespeak.net
Tue Apr 8 17:57:59 CEST 2008
Author: arigo
Date: Tue Apr 8 17:57:58 2008
New Revision: 53589
Modified:
pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
pypy/branch/jit-hotpath/pypy/jit/codegen/test/rgenop_tests.py
Log:
Don't return the input list directly as a result of
get_frame_info(), in case the caller continues to
mutate the list.
Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py Tue Apr 8 17:57:58 2008
@@ -318,7 +318,7 @@
return self.returnintvar(eax)
def get_frame_info(self, vars_gv):
- return vars_gv
+ return vars_gv[:]
def genop_setfield(self, (offset, fieldsize, kt), gv_ptr, gv_value):
assert fieldsize != 2
Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/test/rgenop_tests.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/test/rgenop_tests.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/test/rgenop_tests.py Tue Apr 8 17:57:58 2008
@@ -1747,7 +1747,12 @@
place = builder1.alloc_frame_place(signed_kind, rgenop.genconst(0))
v6 = builder1.genop_get_frame_base()
c_seven = rgenop.genconst(7)
- frameinfo = builder1.get_frame_info([v3, v4, c_seven, v5])
+ lst = [v3, v4, c_seven, v5]
+ frameinfo = builder1.get_frame_info(lst)
+ assert frameinfo is not lst # it's ok for the backend to return any
+ # opaque object, but if it returns 'lst'
+ # it should make a copy so that the
+ # frontend doesn't mutate it afterwards
# here would be a call
v8 = builder1.genop_absorb_place(place)
args_gv = [v3, v4, v5, v8]
More information about the Pypy-commit
mailing list