diff options
author | chriseth <c@ethdev.com> | 2016-03-11 23:12:34 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-03-11 23:12:34 +0800 |
commit | 2fe6037b9bc42946dafbf0f870ca59546712d14c (patch) | |
tree | 04008b8574ed61d907d6e444076ae549995547ad /KnownState.cpp | |
parent | 05d30fc7cf58ef57238295559aac709338e3c4ea (diff) | |
download | dexon-solidity-2fe6037b9bc42946dafbf0f870ca59546712d14c.tar.gz dexon-solidity-2fe6037b9bc42946dafbf0f870ca59546712d14c.tar.zst dexon-solidity-2fe6037b9bc42946dafbf0f870ca59546712d14c.zip |
Increment sequence number for opcodes that can write to memory or storage.
Diffstat (limited to 'KnownState.cpp')
-rw-r--r-- | KnownState.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/KnownState.cpp b/KnownState.cpp index 39cce3e8..dd269ff4 100644 --- a/KnownState.cpp +++ b/KnownState.cpp @@ -143,10 +143,16 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool ); else { - if (SemanticInformation::invalidatesMemory(_item.instruction())) + bool invMem = SemanticInformation::invalidatesMemory(_item.instruction()); + bool invStor = SemanticInformation::invalidatesStorage(_item.instruction()); + // We could be a bit more fine-grained here (CALL only invalidates part of + // memory, etc), but we do not for now. + if (invMem) resetMemory(); - if (SemanticInformation::invalidatesStorage(_item.instruction())) + if (invStor) resetStorage(); + if (invMem || invStor) + m_sequenceNumber += 2; // Increment by two because it can read and write assertThrow(info.ret <= 1, InvalidDeposit, ""); if (info.ret == 1) setStackElement( |