Commits

Brian Kearns  committed 816b7af Merge

merge heads

  • Participants
  • Parent commits 070c498, ac346c2

Comments (0)

Files changed (2)

File rpython/jit/metainterp/pyjitpl.py

             self.make_result_of_lastop(resbox)
             # ^^^ this is done before handle_possible_exception() because we
             # need the box to show up in get_list_of_active_boxes()
-        if pure and self.metainterp.last_exc_value_box is None:
+        if pure and self.metainterp.last_exc_value_box is None and resbox:
             resbox = self.metainterp.record_result_of_call_pure(resbox)
             exc = exc and not isinstance(resbox, Const)
         if exc:

File rpython/jit/metainterp/test/test_call.py

         res = self.interp_operations(f, [3])
         assert res == f(3)
     
+    def test_call_elidable_none(self):
+        d = {}
+        
+        @jit.elidable
+        def f(a):
+            return d.get(a, None)
+
+        driver = jit.JitDriver(greens = [], reds = ['n'])
+
+        def main(n):
+            while n > 0:
+                driver.jit_merge_point(n=n)
+                f(n)
+                f(n)
+                n -= 1
+            return 3
+
+        self.meta_interp(main, [10])