aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-02-24 00:38:42 +0800
committerchriseth <c@ethdev.com>2017-03-03 22:41:02 +0800
commit455e8a4ef896984b7ce204a998a3392f191a7671 (patch)
tree2cf00212da4b52d2e051f34a80135af1b0785495 /libsolidity/analysis
parent41236cd08c292dba428fa1ae57126fb4ec7e901d (diff)
downloaddexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.tar
dexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.tar.gz
dexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.tar.bz2
dexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.tar.lz
dexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.tar.xz
dexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.tar.zst
dexon-solidity-455e8a4ef896984b7ce204a998a3392f191a7671.zip
Move lambda.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 66f5de6a..10406400 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);
- if (!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,7 +645,9 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
return false;
}
return true;
- }))
+ };
+ assembly::CodeGenerator codeGen(_inlineAssembly.operations(), m_errors);
+ if (!codeGen.typeCheck(identifierAccess))
return false;
return true;
}