[pypy-svn] r71227 - pypy/trunk/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Sun Feb 14 17:06:45 CET 2010


Author: arigo
Date: Sun Feb 14 17:06:44 2010
New Revision: 71227

Modified:
   pypy/trunk/pypy/jit/metainterp/pyjitpl.py
Log:
Adding an assert which could catch e.g. unexpected
exceptions out of CALL_PURE functions.


Modified: pypy/trunk/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/pyjitpl.py	Sun Feb 14 17:06:44 2010
@@ -1068,7 +1068,8 @@
             self.make_result_box(resbox)
         if exc:
             return self.metainterp.handle_exception()
-        return False
+        else:
+            return self.metainterp.assert_no_exception()
 
     def do_residual_call(self, argboxes, descr, exc):
         effectinfo = descr.get_extra_info()
@@ -1084,7 +1085,8 @@
             self.generate_guard(self.pc, rop.GUARD_NOT_FORCED, None, [])
             if exc:
                 return self.metainterp.handle_exception()
-            return False
+            else:
+                return self.metainterp.assert_no_exception()
         else:
             return self.execute_varargs(rop.CALL, argboxes, descr, exc)
 
@@ -1890,6 +1892,10 @@
             frame.generate_guard(frame.pc, rop.GUARD_NO_EXCEPTION, None, [])
             return False
 
+    def assert_no_exception(self):
+        assert not self.cpu.get_exception()
+        return False
+
     def handle_overflow_error(self):
         frame = self.framestack[-1]
         if self.cpu._overflow_flag:



More information about the Pypy-commit mailing list