aboutsummaryrefslogtreecommitdiffstats
path: root/KnownState.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-01-15 23:26:12 +0800
committerchriseth <c@ethdev.com>2016-01-15 23:34:56 +0800
commit1b1b6651cd60fcaded8043dc00e61df075fe2e4a (patch)
tree505d2d3d342ef49e449317ca92324614a8d6a9b5 /KnownState.h
parent6e98243ead4843a4dd28fcae312f3b8af6cc7b03 (diff)
downloaddexon-solidity-1b1b6651cd60fcaded8043dc00e61df075fe2e4a.tar.gz
dexon-solidity-1b1b6651cd60fcaded8043dc00e61df075fe2e4a.tar.zst
dexon-solidity-1b1b6651cd60fcaded8043dc00e61df075fe2e4a.zip
Fix sequence number bug.
This bug resulted in incorrect storage access in some situations. The reason was that when intersecting states, the sequence numbers were not handled and thus some operations with too low sequence numbers were used during code generation.
Diffstat (limited to 'KnownState.h')
-rw-r--r--KnownState.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/KnownState.h b/KnownState.h
index 6dff74a5..c1c602dc 100644
--- a/KnownState.h
+++ b/KnownState.h
@@ -100,13 +100,12 @@ public:
void reset() { resetStorage(); resetMemory(); resetStack(); }
unsigned sequenceNumber() const { return m_sequenceNumber; }
- /// Manually increments the storage and memory sequence number.
- void incrementSequenceNumber() { m_sequenceNumber += 2; }
/// Replaces the state by the intersection with _other, i.e. only equal knowledge is retained.
/// If the stack heighht is different, the smaller one is used and the stack is compared
/// relatively.
- void reduceToCommonKnowledge(KnownState const& _other);
+ /// @param _combineSequenceNumbers if true, sets the sequence number to the maximum of both
+ void reduceToCommonKnowledge(KnownState const& _other, bool _combineSequenceNumbers);
/// @returns a shared pointer to a copy of this state.
std::shared_ptr<KnownState> copy() const { return std::make_shared<KnownState>(*this); }