Commits

Antonio Cuni committed b9ed470

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

  • Participants
  • Parent commits fbae461
  • Branches virtual-raw-mallocs

Comments (0)

Files changed (2)

pypy/jit/metainterp/resume.py

                         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:
             # 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
 

pypy/jit/metainterp/test/test_virtualref.py

                 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
                 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])