Merge pull request #2848 from ethereum/checkViewPure

Enforce view and pure.
This commit is contained in:
chriseth
2017-09-13 18:29:13 +02:00
committed by GitHub
16 changed files with 954 additions and 90 deletions
+11
View File
@@ -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>
@@ -220,6 +221,16 @@ bool CompilerStack::analyze()
noErrors = false;
}
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);