aboutsummaryrefslogtreecommitdiffstats
path: root/KnownState.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-04-30 21:31:16 +0800
committerchriseth <c@ethdev.com>2015-05-06 17:11:16 +0800
commita2e3bcbd0c45a79a9709dc8a69858765ab904805 (patch)
tree1201a25150145a991ef11c5f62465986c6b27dea /KnownState.cpp
parent867101e40981db56d8b72fd363e4f9e376991284 (diff)
downloaddexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.gz
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.zst
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.zip
Make KnownState work with all instructions.
Diffstat (limited to 'KnownState.cpp')
-rw-r--r--KnownState.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/KnownState.cpp b/KnownState.cpp
index 02c6ee13..632777c8 100644
--- a/KnownState.cpp
+++ b/KnownState.cpp
@@ -101,6 +101,7 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool
vector<Id> arguments(info.args);
for (int i = 0; i < info.args; ++i)
arguments[i] = stackElement(m_stackHeight - i, _item.getLocation());
+
if (_item.instruction() == Instruction::SSTORE)
op = storeInStorage(arguments[0], arguments[1], _item.getLocation());
else if (_item.instruction() == Instruction::SLOAD)
@@ -121,10 +122,16 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool
applySha3(arguments.at(0), arguments.at(1), _item.getLocation())
);
else
+ {
+ if (SemanticInformation::invalidatesMemory(_item.instruction()))
+ resetMemory();
+ if (SemanticInformation::invalidatesStorage(_item.instruction()))
+ resetStorage();
setStackElement(
m_stackHeight + _item.deposit(),
m_expressionClasses->find(_item, arguments, _copyItem)
);
+ }
}
m_stackHeight += _item.deposit();
}