Skip to content

Commit c2afc7e

Browse files
author
palkeo
committed
Handle unknown opcodes (as invalid opcode)
1 parent 994f75e commit c2afc7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pano/vm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ def handle_jumps(self, trace, line, condition):
419419
trace.append((op, ))
420420
return trace
421421

422+
if op == 'UNKNOWN':
423+
trace.append(('invalid', ))
424+
return trace
425+
422426
if op in ['return', 'revert']:
423427
p = stack.pop()
424428
n = stack.pop()
@@ -470,7 +474,7 @@ def trace_extend(l):
470474
else:
471475
trace('[{}] {} {}',line[0],C.asm(op),C.asm(str(line[2])))
472476

473-
assert op not in ['jump', 'jumpi', 'revert', 'return', 'stop', 'jumpdest']
477+
assert op not in ['jump', 'jumpi', 'revert', 'return', 'stop', 'jumpdest', 'UNKNOWN']
474478

475479
param = 0
476480
if len(line)>2:

0 commit comments

Comments
 (0)