aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-22 23:16:27 +0800
committerchriseth <chris@ethereum.org>2018-03-02 00:19:35 +0800
commita53d6b499d5cc5c45fc096cea6393dc285581f90 (patch)
tree751f9bf0eb4595df500214594865ab12c6bdb4a2 /libsolidity
parentf2f61f1c2f3b4d553c07fcf1746f49e799cb7aa4 (diff)
downloaddexon-solidity-a53d6b499d5cc5c45fc096cea6393dc285581f90.tar.gz
dexon-solidity-a53d6b499d5cc5c45fc096cea6393dc285581f90.tar.zst
dexon-solidity-a53d6b499d5cc5c45fc096cea6393dc285581f90.zip
Use EVM version in type checker.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.h9
-rw-r--r--libsolidity/interface/CompilerStack.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/libsolidity/analysis/TypeChecker.h b/libsolidity/analysis/TypeChecker.h
index 16796b63..2ba31232 100644
--- a/libsolidity/analysis/TypeChecker.h
+++ b/libsolidity/analysis/TypeChecker.h
@@ -22,6 +22,8 @@
#pragma once
+#include <libsolidity/interface/EVMVersion.h>
+
#include <libsolidity/ast/Types.h>
#include <libsolidity/ast/ASTAnnotations.h>
#include <libsolidity/ast/ASTForward.h>
@@ -43,7 +45,10 @@ class TypeChecker: private ASTConstVisitor
{
public:
/// @param _errorReporter provides the error logging functionality.
- TypeChecker(ErrorReporter& _errorReporter): m_errorReporter(_errorReporter) {}
+ TypeChecker(EVMVersion _evmVersion, ErrorReporter& _errorReporter):
+ m_evmVersion(_evmVersion),
+ m_errorReporter(_errorReporter)
+ {}
/// Performs type checking on the given contract and all of its sub-nodes.
/// @returns true iff all checks passed. Note even if all checks passed, errors() can still contain warnings
@@ -132,6 +137,8 @@ private:
ContractDefinition const* m_scope = nullptr;
+ EVMVersion m_evmVersion;
+
/// Flag indicating whether we are currently inside an EmitStatement.
bool m_insideEmitStatement = false;
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 2f733825..cb1ca3aa 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -205,7 +205,7 @@ bool CompilerStack::analyze()
m_contracts[contract->fullyQualifiedName()].contract = contract;
}
- TypeChecker typeChecker(m_errorReporter);
+ TypeChecker typeChecker(m_evmVersion, m_errorReporter);
for (Source const* source: m_sourceOrder)
for (ASTPointer<ASTNode> const& node: source->ast->nodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))