Skip to content

Commit

Permalink
Follow 'stray' gotos, skipping catch-blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphan Kochen committed Nov 6, 2011
1 parent 29e9b37 commit 6622018
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions burger/toppings/packetinstructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,17 @@ def operations(jar, classname, args=('java.io.DataOutputStream',),
# Decode the instructions
operations = []
stack = []
skip_until = -1
shortif_pos = -1
shortif_cond = ''

for instruction in method.instructions:
if skip_until != -1:
if instruction.pos == skip_until:
skip_until = -1
else:
continue

opcode = instruction.opcode
operands = [InstructionField(operand, instruction, cf.constants)
for operand in instruction.operands]
Expand Down Expand Up @@ -326,6 +333,8 @@ def operations(jar, classname, args=('java.io.DataOutputStream',),
else:
endif.operation = "endloop"
_PIT.find_next(operations, target, "if").operation = "loop"
elif target > instruction.pos:
skip_until = target

# Math
elif opcode >= 0x74 and opcode <= 0x77:
Expand Down

0 comments on commit 6622018

Please sign in to comment.