Merge pull request #304 from norhh/bugfix/codesize

Use bytecode length as CODESIZE
pull/275/merge
Nikhil Parasaram 7 years ago committed by GitHub
commit dc0e93566a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      mythril/disassembler/disassembly.py
  2. 2
      mythril/laser/ethereum/svm.py

@ -11,6 +11,7 @@ class Disassembly:
self.xrefs = [] self.xrefs = []
self.func_to_addr = {} self.func_to_addr = {}
self.addr_to_func = {} self.addr_to_func = {}
self.bytecode = code
try: try:
mythril_dir = os.environ['MYTHRIL_DIR'] mythril_dir = os.environ['MYTHRIL_DIR']

@ -635,7 +635,7 @@ class LaserEVM:
state.stack.append(environment.sender) state.stack.append(environment.sender)
elif op == 'CODESIZE': elif op == 'CODESIZE':
state.stack.append(len(disassembly.instruction_list)) state.stack.append(len(disassembly.bytecode) // 2)
if op == 'SHA3': if op == 'SHA3':
op0, op1 = state.stack.pop(), state.stack.pop() op0, op1 = state.stack.pop(), state.stack.pop()

Loading…
Cancel
Save