diff options
author | Federico Bond <federicobond@gmail.com> | 2016-12-01 21:55:02 +0800 |
---|---|---|
committer | Federico Bond <federicobond@gmail.com> | 2016-12-09 03:22:13 +0800 |
commit | 05139500fb44c1ff574756b3a5d10d46674c236d (patch) | |
tree | 252284ed87c33e648dd955739dfe104c12bad323 /libsolidity/interface | |
parent | 84443eb56022cdb236425b99e253d0b142261372 (diff) | |
download | dexon-solidity-05139500fb44c1ff574756b3a5d10d46674c236d.tar.gz dexon-solidity-05139500fb44c1ff574756b3a5d10d46674c236d.tar.zst dexon-solidity-05139500fb44c1ff574756b3a5d10d46674c236d.zip |
Warn about using msg.value in non-payable function
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index b4fd6d87..eb588fc2 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -32,6 +32,7 @@ #include <libsolidity/analysis/NameAndTypeResolver.h> #include <libsolidity/analysis/TypeChecker.h> #include <libsolidity/analysis/DocStringAnalyser.h> +#include <libsolidity/analysis/StaticAnalyzer.h> #include <libsolidity/analysis/SyntaxChecker.h> #include <libsolidity/codegen/Compiler.h> #include <libsolidity/interface/InterfaceHandler.h> @@ -202,6 +203,15 @@ bool CompilerStack::parse() m_contracts[contract->name()].contract = contract; } + + if (noErrors) + { + StaticAnalyzer staticAnalyzer(m_errors); + for (Source const* source: m_sourceOrder) + if (!staticAnalyzer.analyze(*source->ast)) + noErrors = false; + } + m_parseSuccessful = noErrors; return m_parseSuccessful; } |