[pypy-commit] pypy release-2.3.x: Fix: un-comment some assertion that is really checking an important

arigo noreply at buildbot.pypy.org
Tue May 27 19:43:36 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: release-2.3.x
Changeset: r71743:6fb181888bbf
Date: 2014-05-27 17:57 +0200
http://bitbucket.org/pypy/pypy/changeset/6fb181888bbf/

Log:	Fix: un-comment some assertion that is really checking an important
	property; and fix test_string:test_promote_string() by not calling
	make_result_of_lastop() indirectly from opimpl_str_guard_value().

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
@@ -167,12 +167,11 @@
 
     def make_result_of_lastop(self, resultbox):
         got_type = resultbox.type
-        # XXX disabled for now, conflicts with str_guard_value
-        #if not we_are_translated():
-        #    typeof = {'i': history.INT,
-        #              'r': history.REF,
-        #              'f': history.FLOAT}
-        #    assert typeof[self.jitcode._resulttypes[self.pc]] == got_type
+        if not we_are_translated():
+            typeof = {'i': history.INT,
+                      'r': history.REF,
+                      'f': history.FLOAT}
+            assert typeof[self.jitcode._resulttypes[self.pc]] == got_type
         target_index = ord(self.bytecode[self.pc-1])
         if got_type == history.INT:
             self.registers_i[target_index] = resultbox
@@ -1321,14 +1320,14 @@
         self.metainterp.clear_exception()
         resbox = self.metainterp.execute_and_record_varargs(opnum, argboxes,
                                                             descr=descr)
-        if resbox is not None:
-            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 and resbox:
             resbox = self.metainterp.record_result_of_call_pure(resbox)
             exc = exc and not isinstance(resbox, Const)
         if exc:
+            if resbox is not None:
+                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()
             self.metainterp.handle_possible_exception()
         else:
             self.metainterp.assert_no_exception()


More information about the pypy-commit mailing list