aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-03-08 18:56:44 +0800
committerGitHub <noreply@github.com>2017-03-08 18:56:44 +0800
commita1e350a4aeef11865d2deee5a4e59feb0625d053 (patch)
tree1ee5814805c2f9e440714cb115c1102f363e8258 /libsolidity/analysis
parenta2ac05e1a2cee0be25234d5f595e8adf2372fb88 (diff)
parentf8ce32f2a6899a7026a754b44c4b68d009e1742e (diff)
downloaddexon-solidity-a1e350a4aeef11865d2deee5a4e59feb0625d053.tar.gz
dexon-solidity-a1e350a4aeef11865d2deee5a4e59feb0625d053.tar.zst
dexon-solidity-a1e350a4aeef11865d2deee5a4e59feb0625d053.zip
Merge pull request #1699 from ethereum/asmlabels
Assembly labels with stack information
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index ee970e5d..93b183a2 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -592,8 +592,12 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
// Inline assembly does not have its own type-checking phase, so we just run the
// code-generator and see whether it produces any errors.
// External references have already been resolved in a prior stage and stored in the annotation.
- assembly::CodeGenerator codeGen(_inlineAssembly.operations(), m_errors);
- codeGen.typeCheck([&](assembly::Identifier const& _identifier, eth::Assembly& _assembly, assembly::CodeGenerator::IdentifierContext _context) {
+ auto identifierAccess = [&](
+ assembly::Identifier const& _identifier,
+ eth::Assembly& _assembly,
+ assembly::CodeGenerator::IdentifierContext _context
+ )
+ {
auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier);
if (ref == _inlineAssembly.annotation().externalReferences.end())
return false;
@@ -641,8 +645,11 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
return false;
}
return true;
- });
- return false;
+ };
+ assembly::CodeGenerator codeGen(_inlineAssembly.operations(), m_errors);
+ if (!codeGen.typeCheck(identifierAccess))
+ return false;
+ return true;
}
bool TypeChecker::visit(IfStatement const& _ifStatement)