diff options
author | chriseth <chris@ethereum.org> | 2017-09-14 00:29:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 00:29:13 +0800 |
commit | 3f3bcc4f8a0d12e9b92d6b63e7cfd92cbbfa775d (patch) | |
tree | 5a8f36e2b2491e07534d9c1570b8f40a2235c4c5 /libsolidity/interface | |
parent | 72b7e001aa837ab59b3b14bfbabf69bbd102ded1 (diff) | |
parent | 172704a58fa2b7562107b8df299c5a81ba702d12 (diff) | |
download | dexon-solidity-3f3bcc4f8a0d12e9b92d6b63e7cfd92cbbfa775d.tar.gz dexon-solidity-3f3bcc4f8a0d12e9b92d6b63e7cfd92cbbfa775d.tar.zst dexon-solidity-3f3bcc4f8a0d12e9b92d6b63e7cfd92cbbfa775d.zip |
Merge pull request #2848 from ethereum/checkViewPure
Enforce view and pure.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 41bbf687..51544f8a 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -36,6 +36,7 @@ #include <libsolidity/analysis/StaticAnalyzer.h> #include <libsolidity/analysis/PostTypeChecker.h> #include <libsolidity/analysis/SyntaxChecker.h> +#include <libsolidity/analysis/ViewPureChecker.h> #include <libsolidity/codegen/Compiler.h> #include <libsolidity/formal/SMTChecker.h> #include <libsolidity/interface/ABI.h> @@ -222,6 +223,16 @@ bool CompilerStack::analyze() if (noErrors) { + vector<ASTPointer<ASTNode>> ast; + for (Source const* source: m_sourceOrder) + ast.push_back(source->ast); + + if (!ViewPureChecker(ast, m_errorReporter).check()) + noErrors = false; + } + + if (noErrors) + { SMTChecker smtChecker(m_errorReporter, m_smtQuery); for (Source const* source: m_sourceOrder) smtChecker.analyze(*source->ast); |