From 952699010d1b356696b3d50bcd949699792d9d0b Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 26 Jun 2019 20:59:01 +0530 Subject: [PATCH] Add an extra map --- mythril/laser/ethereum/state/account.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mythril/laser/ethereum/state/account.py b/mythril/laser/ethereum/state/account.py index bd594e8d..2b465706 100644 --- a/mythril/laser/ethereum/state/account.py +++ b/mythril/laser/ethereum/state/account.py @@ -21,10 +21,10 @@ class Storage: """ if concrete: self._standard_storage = K(256, 256, 0) # type: BaseArray - self._map_storage = {} # type: Dict[BitVec, BaseArray] else: self._standard_storage = Array("Storage", 256, 256) - self._map_storage = {} + self._map_storage = {} + self._keccak_map_storage = {} # type: Dict[BitVec, BaseArray] self.printable_storage = {} # type: Dict[BitVec, BitVec] @@ -74,9 +74,14 @@ class Storage: index = self.get_map_index(key) if index is None: storage = self._standard_storage + else: + if isinstance(key, BitVecFunc) and key.func_name == "keccak256": + storage_map = self._keccak_map_storage + else: + storage_map = self._map_storage try: - storage = self._map_storage[index] + storage = storage_map[index] except KeyError: if isinstance(self._standard_storage, Array): self._map_storage[index] = Array("Storage", 256, 256)