Fix the graph tests

pull/1133/head
Nikhil 5 years ago
parent d7b4f6b4e8
commit 541182db03
  1. 10
      mythril/laser/ethereum/instructions.py
  2. 4
      mythril/laser/ethereum/state/memory.py

@ -1596,9 +1596,13 @@ class Instruction:
"""
state = global_state.mstate
offset, length = state.stack.pop(), state.stack.pop()
state.mem_extend(offset, length)
StateTransition.check_gas_usage_limit(global_state)
return_data = state.memory[offset : offset + length]
if length.symbolic:
return_data = [global_state.new_bitvec("return_data", 8)]
log.debug("Return with symbolic length or offset. Not supported")
else:
state.mem_extend(offset, length)
StateTransition.check_gas_usage_limit(global_state)
return_data = state.memory[offset : offset + length]
global_state.current_transaction.end(global_state, return_data)
@StateTransition()

@ -137,7 +137,7 @@ class Memory:
start, stop, step = convert_bv(start), convert_bv(stop), convert_bv(step)
ret_lis = []
itr = symbol_factory.BitVecVal(0, 256)
while simplify(start + itr != stop) and itr <= 10000000:
while simplify(start + itr < stop) and itr <= 10000000:
ret_lis.append(self[start + step * itr])
itr += 1
@ -170,7 +170,7 @@ class Memory:
assert type(value) == list
start, stop, step = convert_bv(start), convert_bv(stop), convert_bv(step)
itr = symbol_factory.BitVecVal(0, 256)
while simplify(start + itr != stop) and itr <= 10000000:
while simplify(start + itr < stop) and itr <= 10000000:
self[start + itr] = value[itr.value]
itr += 1

Loading…
Cancel
Save