Merge pull request #851 from ConsenSys/bugfix/846

Put BitVecVals in stack
pull/854/head
Nikhil Parasaram 6 years ago committed by GitHub
commit a15ad689c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      mythril/laser/ethereum/instructions.py
  2. 2
      mythril/laser/ethereum/state/account.py
  3. 8
      mythril/laser/ethereum/state/memory.py

@ -371,7 +371,9 @@ class Instruction:
)
else:
state.stack.append(pow(base.value, exponent.value, 2 ** 256))
state.stack.append(
symbol_factory.BitVecVal(pow(base.value, exponent.value, 2 ** 256), 256)
)
return [global_state]

@ -44,7 +44,7 @@ class Storage:
except ValueError:
pass
if self.concrete:
return 0
return symbol_factory.BitVecVal(0, 256)
self._storage[item] = symbol_factory.BitVecVal(0, 256)
return self._storage[item]

@ -29,8 +29,12 @@ class Memory:
:return: 32 byte word at the specified index
"""
try:
return util.concrete_int_from_bytes(
bytes([util.get_concrete_int(b) for b in self[index : index + 32]]), 0
return symbol_factory.BitVecVal(
util.concrete_int_from_bytes(
bytes([util.get_concrete_int(b) for b in self[index : index + 32]]),
0,
),
256,
)
except:
result = simplify(

Loading…
Cancel
Save