PyPy 3.2 bug confusing RETURN_END_IF for except

Also fix a instruction formatting bug
This commit is contained in:
rocky 2016-07-28 00:40:01 -04:00
parent ac121076e6
commit 5c9c0228ee
3 changed files with 7 additions and 2 deletions

View File

@ -735,6 +735,10 @@ class Scanner3(scan.Scanner):
self.structs.append({'type': 'if-then',
'start': start,
'end': rtarget})
jump_prev = prev_op[offset]
if self.is_pypy and code[jump_prev] == self.opc.COMPARE_OP:
if self.opc.cmp_op[code[jump_prev+1]] == 'exception match':
return
self.return_end_ifs.add(prev_op[rtarget])
elif op in self.jump_if_pop:

View File

@ -69,8 +69,9 @@ class Token:
pattr = "to " + str(self.pattr)
pass
elif self.op in self.opc.hascompare:
pattr = self.opc.cmp_op[self.attr]
# And so on. See xdis/bytecode.py get_instructions_bytes
if isinstance(self.attr, int):
pattr = self.opc.cmp_op[self.attr]
# And so on. See xdis/bytecode.py get_instructions_bytes
pass
else:
pattr = ''