Author: Antonio Cuni <[email protected]>
Branch: virtual-raw-mallocs
Changeset: r59625:b9ed4709a910
Date: 2012-12-29 21:08 +0100
http://bitbucket.org/pypy/pypy/changeset/b9ed4709a910/

Log:    tweak the test to make it failing because of raw virtuals, and fix
        the code

diff --git a/pypy/jit/metainterp/resume.py b/pypy/jit/metainterp/resume.py
--- a/pypy/jit/metainterp/resume.py
+++ b/pypy/jit/metainterp/resume.py
@@ -763,7 +763,7 @@
                         self.getvirtual_int(i)
                     else:
                         assert False
-        return self.virtuals_cache
+        return self.virtuals_cache, self.virtuals_int_cache
 
     def _prepare_virtuals(self, virtuals):
         if virtuals:
@@ -1142,7 +1142,7 @@
             # special case for resuming after a GUARD_NOT_FORCED: we already
             # have the virtuals
             self.resume_after_guard_not_forced = 2
-            self.virtuals_cache = all_virtuals
+            self.virtuals_cache, self.virtuals_int_cache = all_virtuals
             # self.rd_virtuals can remain None, because virtuals_cache is
             # already filled
 
diff --git a/pypy/jit/metainterp/test/test_virtualref.py 
b/pypy/jit/metainterp/test/test_virtualref.py
--- a/pypy/jit/metainterp/test/test_virtualref.py
+++ b/pypy/jit/metainterp/test/test_virtualref.py
@@ -307,6 +307,8 @@
                 xy.next1 = lltype.malloc(A, 0)
                 xy.next2 = lltype.malloc(A, 0)
                 xy.next3 = lltype.malloc(A, 0)
+                buf = lltype.malloc(rffi.CCHARP.TO, 1, flavor='raw')
+                buf[0] = chr(n)
                 # this is a raw virtual
                 xy.next4 = lltype.malloc(rffi.CCHARP.TO, 1, flavor='raw')
                 xy.n = n
@@ -319,6 +321,7 @@
                 xy.next4 = lltype.nullptr(rffi.CCHARP.TO)
                 virtual_ref_finish(vref, xy)
                 exctx.topframeref = vref_None
+                lltype.free(buf, flavor='raw')
             return exctx.m
         #
         res = self.meta_interp(f, [30])
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to