[pypy-commit] pypy default: merge heads

bdkearns noreply at buildbot.pypy.org
Mon Feb 25 14:12:21 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r61759:816b7affe3c1
Date: 2013-02-25 08:11 -0500
http://bitbucket.org/pypy/pypy/changeset/816b7affe3c1/

Log:	merge heads

diff --git a/rpython/jit/metainterp/pyjitpl.py b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -1296,7 +1296,7 @@
             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:
diff --git a/rpython/jit/metainterp/test/test_call.py b/rpython/jit/metainterp/test/test_call.py
--- a/rpython/jit/metainterp/test/test_call.py
+++ b/rpython/jit/metainterp/test/test_call.py
@@ -25,3 +25,21 @@
         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])


More information about the pypy-commit mailing list