Fix edelweiss crash and various other issues (#1474)

pull/1480/head
Nikhil Parasaram 4 years ago committed by GitHub
parent b3184c3a1a
commit 7a0f803808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      mythril/analysis/module/modules/dependence_on_predictable_vars.py
  2. 6
      mythril/analysis/module/modules/state_change_external_calls.py
  3. 2
      mythril/ethereum/evmcontract.py
  4. 4
      mythril/laser/ethereum/instructions.py
  5. 7
      mythril/laser/ethereum/state/machine_state.py

@ -1,7 +1,6 @@
"""This module contains the detection code for predictable variable
dependence."""
import logging
from copy import copy
from mythril.analysis.module.base import DetectionModule, EntryPoint
from mythril.analysis.report import Issue

@ -154,9 +154,9 @@ class StateChangeAfterCall(DetectionModule):
)
op_code = global_state.get_current_instruction()["opcode"]
if len(annotations) == 0:
if op_code in STATE_READ_WRITE_LIST:
return []
if len(annotations) == 0 and op_code in STATE_READ_WRITE_LIST:
return []
if op_code in STATE_READ_WRITE_LIST:
for annotation in annotations:
annotation.state_change_states.append(global_state)

@ -117,6 +117,4 @@ class EVMContract(persistent.Persistent):
str_eval += '"' + sign_hash + '" in self.disassembly.func_hashes'
continue
return eval(str_eval.strip())

@ -1,11 +1,9 @@
"""This module contains a representation class for EVM instructions and
transitions between them."""
import binascii
import logging
from copy import copy, deepcopy
from typing import cast, Callable, List, Union, Optional
from datetime import datetime
from typing import cast, Callable, List, Union
from mythril.laser.smt import (
Extract,

@ -3,7 +3,7 @@ stack."""
from copy import copy
from typing import cast, Sized, Union, Any, List, Dict, Optional
from mythril.laser.smt import BitVec, Expression, symbol_factory
from mythril.laser.smt import BitVec, Bool, If, Expression, symbol_factory
from ethereum import opcodes, utils
from mythril.laser.ethereum.evm_exceptions import (
@ -11,7 +11,6 @@ from mythril.laser.ethereum.evm_exceptions import (
StackUnderflowException,
OutOfGasException,
)
from mythril.laser.smt import Bool, If
from mythril.laser.ethereum.state.memory import Memory
@ -43,7 +42,6 @@ class MachineStack(list):
symbol_factory.BitVecVal(1, 256),
symbol_factory.BitVecVal(0, 256),
)
print(element)
if super(MachineStack, self).__len__() >= self.STACK_LIMIT:
raise StackOverflowException(
"Reached the EVM stack limit of {}, you can't append more "
@ -93,7 +91,8 @@ class MachineStack(list):
class MachineState:
"""MachineState represents current machine state also referenced to as \mu.
"""
MachineState represents current machine state also referenced to as \mu.
"""
def __init__(

Loading…
Cancel
Save