Fix typehints for latest mypy release (#1221)

bug/instructions-out-of-bounds
Nikhil Parasaram 5 years ago committed by GitHub
parent 028fae6ff1
commit 90f2de8555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      mythril/analysis/modules/unchecked_retval.py
  2. 2
      mythril/laser/ethereum/state/calldata.py

@ -116,13 +116,9 @@ class UncheckedRetvalModule(DetectionModule):
assert state.environment.code.instruction_list[state.mstate.pc - 1][
"opcode"
] in ["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"]
retval = state.mstate.stack[-1]
# Use Typed Dict after release of mypy 0.670 and remove type ignore
return_value = state.mstate.stack[-1]
retvals.append(
{ # type: ignore
"address": state.instruction["address"] - 1,
"retval": retval,
}
{"address": state.instruction["address"] - 1, "retval": return_value}
)
return []

@ -70,7 +70,7 @@ class BaseCalldata:
try:
current_index = (
start
if isinstance(start, Expression)
if isinstance(start, BitVec)
else symbol_factory.BitVecVal(start, 256)
)
parts = []

Loading…
Cancel
Save