aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-04-26 21:41:08 +0800
committerchriseth <chris@ethereum.org>2017-04-26 23:12:04 +0800
commitf3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb (patch)
treebe9367a377cd81badbac4bbf6bdf5377586823b3 /libsolidity/analysis
parent68218387cf29b3ce7de72aa0348e68dbdae29751 (diff)
downloaddexon-solidity-f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb.tar.gz
dexon-solidity-f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb.tar.zst
dexon-solidity-f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb.zip
Refactor to combined scope and stack height info.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp7
-rw-r--r--libsolidity/analysis/TypeChecker.cpp10
2 files changed, 13 insertions, 4 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index a8231b13..9433976a 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -26,6 +26,7 @@
#include <libsolidity/interface/Exceptions.h>
#include <libsolidity/analysis/ConstantEvaluator.h>
#include <libsolidity/inlineasm/AsmAnalysis.h>
+#include <libsolidity/inlineasm/AsmAnalysisInfo.h>
#include <libsolidity/inlineasm/AsmData.h>
#include <boost/algorithm/string.hpp>
@@ -190,8 +191,10 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly)
_inlineAssembly.annotation().externalReferences[&_identifier].declaration = declarations.front();
return size_t(1);
};
- assembly::AsmAnalyzer::Scopes scopes;
- assembly::AsmAnalyzer(scopes, errorsIgnored, resolver).analyze(_inlineAssembly.operations());
+
+ // Will be re-generated later with correct information
+ assembly::AsmAnalysisInfo analysisInfo;
+ assembly::AsmAnalyzer(analysisInfo, errorsIgnored, resolver).analyze(_inlineAssembly.operations());
return false;
}
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 08a49f51..38cdc1f8 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -25,6 +25,7 @@
#include <boost/range/adaptor/reversed.hpp>
#include <libsolidity/ast/AST.h>
#include <libsolidity/inlineasm/AsmAnalysis.h>
+#include <libsolidity/inlineasm/AsmAnalysisInfo.h>
#include <libsolidity/inlineasm/AsmData.h>
using namespace std;
@@ -705,8 +706,13 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
ref->second.valueSize = 1;
return size_t(1);
};
- solAssert(_inlineAssembly.annotation().scopes.empty(), "");
- assembly::AsmAnalyzer analyzer(_inlineAssembly.annotation().scopes, m_errors, identifierAccess);
+ solAssert(!_inlineAssembly.annotation().analysisInfo, "");
+ _inlineAssembly.annotation().analysisInfo = make_shared<assembly::AsmAnalysisInfo>();
+ assembly::AsmAnalyzer analyzer(
+ *_inlineAssembly.annotation().analysisInfo,
+ m_errors,
+ identifierAccess
+ );
if (!analyzer.analyze(_inlineAssembly.operations()))
return false;
return true;