diff options
author | chriseth <c@ethdev.com> | 2015-04-30 17:40:43 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-06 17:10:03 +0800 |
commit | 3ebb7d99c4e24d7bc963c419790c9f0081cc47a1 (patch) | |
tree | 9d20776d37f187127b8e9e720cbde9e2e8f6f575 /ExpressionClasses.h | |
parent | 9106d72a02aa52b0c48db2eef7e4f9df213500b5 (diff) | |
download | dexon-solidity-3ebb7d99c4e24d7bc963c419790c9f0081cc47a1.tar.gz dexon-solidity-3ebb7d99c4e24d7bc963c419790c9f0081cc47a1.tar.zst dexon-solidity-3ebb7d99c4e24d7bc963c419790c9f0081cc47a1.zip |
More flexible way to approach unknown stack elements.
Diffstat (limited to 'ExpressionClasses.h')
-rw-r--r-- | ExpressionClasses.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ExpressionClasses.h b/ExpressionClasses.h index 2f720f60..5d32c0f7 100644 --- a/ExpressionClasses.h +++ b/ExpressionClasses.h @@ -50,7 +50,7 @@ public: struct Expression { Id id; - AssemblyItem const* item; + AssemblyItem const* item = nullptr; Ids arguments; unsigned sequenceNumber; ///< Storage modification sequence, only used for SLOAD/SSTORE instructions. /// Behaves as if this was a tuple of (item->type(), item->data(), arguments, sequenceNumber). @@ -68,6 +68,10 @@ public: bool _copyItem = true, unsigned _sequenceNumber = 0 ); + /// @returns a new unique class id which does not and will never have a representative containing + /// an AssemblyItem, i.e. its value cannot be generated, instead it has to be assumed to be + /// already present. + Id newId(); /// @returns the canonical representative of an expression class. Expression const& representative(Id _id) const { return m_representatives.at(_id); } /// @returns the number of classes. @@ -149,7 +153,7 @@ public: std::string toString() const; private: - bool matchesBaseItem(AssemblyItem const& _item) const; + bool matchesBaseItem(AssemblyItem const* _item) const; Expression const& matchGroupValue() const; AssemblyItemType m_type; |