aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/CompilerStack.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-03 19:51:51 +0800
committerchriseth <c@ethdev.com>2017-03-06 22:05:09 +0800
commit5c5d83fd704e18f88d80e346386e97ed600b7281 (patch)
tree7a689acc32f72a20889d685686d5d293e78f9e0a /libsolidity/interface/CompilerStack.cpp
parentd089a1ef2b4d9dbcdeb311edc3efd5df74282ba3 (diff)
downloaddexon-solidity-5c5d83fd704e18f88d80e346386e97ed600b7281.tar.gz
dexon-solidity-5c5d83fd704e18f88d80e346386e97ed600b7281.tar.zst
dexon-solidity-5c5d83fd704e18f88d80e346386e97ed600b7281.zip
Check for circular references in constant variables.
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r--libsolidity/interface/CompilerStack.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 9d8d872f..594efb1e 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -34,6 +34,7 @@
#include <libsolidity/analysis/TypeChecker.h>
#include <libsolidity/analysis/DocStringAnalyser.h>
#include <libsolidity/analysis/StaticAnalyzer.h>
+#include <libsolidity/analysis/PostTypeChecker.h>
#include <libsolidity/analysis/SyntaxChecker.h>
#include <libsolidity/codegen/Compiler.h>
#include <libsolidity/interface/InterfaceHandler.h>
@@ -219,6 +220,14 @@ bool CompilerStack::parse()
if (noErrors)
{
+ PostTypeChecker postTypeChecker(m_errors);
+ for (Source const* source: m_sourceOrder)
+ if (!postTypeChecker.check(*source->ast))
+ noErrors = false;
+ }
+
+ if (noErrors)
+ {
StaticAnalyzer staticAnalyzer(m_errors);
for (Source const* source: m_sourceOrder)
if (!staticAnalyzer.analyze(*source->ast))