[pypy-svn] r37900 - in pypy/branch/jit-virtual-world/pypy/jit/timeshifter: . test

arigo at codespeak.net arigo at codespeak.net
Sun Feb 4 13:45:48 CET 2007


Author: arigo
Date: Sun Feb  4 13:45:47 2007
New Revision: 37900

Modified:
   pypy/branch/jit-virtual-world/pypy/jit/timeshifter/rtimeshift.py
   pypy/branch/jit-virtual-world/pypy/jit/timeshifter/test/test_promotion.py
Log:
(pedronis, arigo)
A crash in leave_graph_yellow().


Modified: pypy/branch/jit-virtual-world/pypy/jit/timeshifter/rtimeshift.py
==============================================================================
--- pypy/branch/jit-virtual-world/pypy/jit/timeshifter/rtimeshift.py	(original)
+++ pypy/branch/jit-virtual-world/pypy/jit/timeshifter/rtimeshift.py	Sun Feb  4 13:45:47 2007
@@ -1205,11 +1205,12 @@
     if resuming is not None:
         resuming.leave_call(mydispatchqueue)
     return_chain = mydispatchqueue.return_chain
-    jitstate = return_chain
-    while jitstate is not None:
-        leave_frame(jitstate)
-        jitstate = jitstate.next
-    # return the jitstate which is the head of the chain,
-    # ready for further writing
-    return_chain.curbuilder.start_writing()
+    if return_chain is not None:
+        jitstate = return_chain
+        while jitstate is not None:
+            leave_frame(jitstate)
+            jitstate = jitstate.next
+        # return the jitstate which is the head of the chain,
+        # ready for further writing
+        return_chain.curbuilder.start_writing()
     return return_chain

Modified: pypy/branch/jit-virtual-world/pypy/jit/timeshifter/test/test_promotion.py
==============================================================================
--- pypy/branch/jit-virtual-world/pypy/jit/timeshifter/test/test_promotion.py	(original)
+++ pypy/branch/jit-virtual-world/pypy/jit/timeshifter/test/test_promotion.py	Sun Feb  4 13:45:47 2007
@@ -370,3 +370,17 @@
         res = self.timeshift(ll_function, ["oe", 1], [],
                              policy=StopAtXPolicy(w))
         res == 1
+
+    def test_promote_in_yellow_call(self):
+        def ll_two(n):
+            n = hint(n, promote=True)
+            return n + 2
+            
+        def ll_function(n):
+            hint(None, global_merge_point=True)
+            c = ll_two(n)
+            return hint(c, variable=True)
+
+        res = self.timeshift(ll_function, [4], [], policy=P_NOVIRTUAL)
+        assert res == 6
+        self.check_insns(int_add=0)



More information about the Pypy-commit mailing list