aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/NameAndTypeResolver.cpp2
-rw-r--r--libsolidity/analysis/NameAndTypeResolver.h8
2 files changed, 8 insertions, 2 deletions
diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp
index 5fea91d6..ed1bd1d3 100644
--- a/libsolidity/analysis/NameAndTypeResolver.cpp
+++ b/libsolidity/analysis/NameAndTypeResolver.cpp
@@ -34,8 +34,10 @@ namespace solidity
NameAndTypeResolver::NameAndTypeResolver(
vector<Declaration const*> const& _globals,
+ map<ASTNode const*, shared_ptr<DeclarationContainer>>& _scopes,
ErrorList& _errors
) :
+ m_scopes(_scopes),
m_errors(_errors)
{
if (!m_scopes[nullptr])
diff --git a/libsolidity/analysis/NameAndTypeResolver.h b/libsolidity/analysis/NameAndTypeResolver.h
index 67a6c0e4..1c7af0c9 100644
--- a/libsolidity/analysis/NameAndTypeResolver.h
+++ b/libsolidity/analysis/NameAndTypeResolver.h
@@ -42,7 +42,11 @@ namespace solidity
class NameAndTypeResolver: private boost::noncopyable
{
public:
- NameAndTypeResolver(std::vector<Declaration const*> const& _globals, ErrorList& _errors);
+ NameAndTypeResolver(
+ std::vector<Declaration const*> const& _globals,
+ std::map<ASTNode const*, std::shared_ptr<DeclarationContainer>>& _scopes,
+ ErrorList& _errors
+ );
/// Registers all declarations found in the AST node, usually a source unit.
/// @returns false in case of error.
bool registerDeclarations(ASTNode& _sourceUnit);
@@ -113,7 +117,7 @@ private:
/// where nullptr denotes the global scope. Note that structs are not scope since they do
/// not contain code.
/// Aliases (for example `import "x" as y;`) create multiple pointers to the same scope.
- std::map<ASTNode const*, std::shared_ptr<DeclarationContainer>> m_scopes;
+ std::map<ASTNode const*, std::shared_ptr<DeclarationContainer>>& m_scopes;
DeclarationContainer* m_currentScope = nullptr;
ErrorList& m_errors;