Read about our upcoming Code of Conduct on this issue

Commit 5330ab90 authored by Armin Rigo's avatar Armin Rigo
Browse files

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().
parent b13ff9f02cb0
......@@ -167,12 +167,11 @@ class MIFrame(object):
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 @@ class MIFrame(object):
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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment