diff options
author | chriseth <c@ethdev.com> | 2016-07-21 01:37:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-21 01:37:57 +0800 |
commit | 980abfe52aac3161dc4f25574da83bfc6be977bf (patch) | |
tree | 4e60a2a847fa55abbcb79b275f8994cf2807fce2 /libsolidity/formal/Why3Translator.h | |
parent | 427deb43f56e1dca5df31db22e9ee9df9c7b5182 (diff) | |
parent | 26e5faa038d09fe04a3aad7b384d3433324a9380 (diff) | |
download | dexon-solidity-980abfe52aac3161dc4f25574da83bfc6be977bf.tar.gz dexon-solidity-980abfe52aac3161dc4f25574da83bfc6be977bf.tar.zst dexon-solidity-980abfe52aac3161dc4f25574da83bfc6be977bf.zip |
Merge pull request #720 from chriseth/formalState
Formal Verification: Handle external effects.
Diffstat (limited to 'libsolidity/formal/Why3Translator.h')
-rw-r--r-- | libsolidity/formal/Why3Translator.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libsolidity/formal/Why3Translator.h b/libsolidity/formal/Why3Translator.h index 588b6d80..e5b16844 100644 --- a/libsolidity/formal/Why3Translator.h +++ b/libsolidity/formal/Why3Translator.h @@ -80,6 +80,7 @@ private: virtual bool visit(IfStatement const& _node) override; virtual bool visit(WhileStatement const& _node) override; virtual bool visit(Return const& _node) override; + virtual bool visit(Throw const& _node) override; virtual bool visit(VariableDeclarationStatement const& _node) override; virtual bool visit(ExpressionStatement const&) override; virtual bool visit(Assignment const& _node) override; @@ -104,6 +105,9 @@ private: bool isLocalVariable(VariableDeclaration const* _var) const; bool isLocalVariable(std::string const& _name) const; + /// @returns a string representing an expression that is a copy of this.storage + std::string copyOfStorage() const; + /// Visits the givin statement and indents it unless it is a block /// (which does its own indentation). void visitIndentedUnlessBlock(Statement const& _statement); @@ -117,7 +121,17 @@ private: bool m_seenContract = false; bool m_errorOccured = false; - std::vector<VariableDeclaration const*> m_stateVariables; + /// Metadata relating to the current contract + struct ContractMetadata + { + ContractDefinition const* contract = nullptr; + std::vector<VariableDeclaration const*> stateVariables; + + void reset() { contract = nullptr; stateVariables.clear(); } + }; + + ContractMetadata m_currentContract; + bool m_currentLValueIsRef = false; std::map<std::string, VariableDeclaration const*> m_localVariables; struct Line @@ -129,6 +143,5 @@ private: ErrorList& m_errors; }; - } } |