mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into develop_060
This commit is contained in:
@@ -207,11 +207,11 @@ void CodeGenerator::assemble(
|
||||
}
|
||||
catch (StackTooDeepError const& _e)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(
|
||||
InternalCompilerError() << errinfo_comment(
|
||||
"Stack too deep when compiling inline assembly" +
|
||||
(_e.comment() ? ": " + *_e.comment() : ".")
|
||||
));
|
||||
solAssert(
|
||||
false,
|
||||
"Stack too deep when compiling inline assembly" +
|
||||
(_e.comment() ? ": " + *_e.comment() : ".")
|
||||
);
|
||||
}
|
||||
solAssert(transform.stackErrors().empty(), "Stack errors present but not thrown.");
|
||||
}
|
||||
|
||||
@@ -82,14 +82,14 @@ void VariableReferenceCounter::operator()(Block const& _block)
|
||||
|
||||
void VariableReferenceCounter::increaseRefIfFound(YulString _variableName)
|
||||
{
|
||||
m_scope->lookup(_variableName, Scope::Visitor(
|
||||
m_scope->lookup(_variableName, GenericVisitor{
|
||||
[=](Scope::Variable const& _var)
|
||||
{
|
||||
++m_context.variableReferences[&_var];
|
||||
},
|
||||
[=](Scope::Label const&) { },
|
||||
[=](Scope::Function const&) { }
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
CodeTransform::CodeTransform(
|
||||
@@ -283,11 +283,11 @@ void CodeTransform::operator()(FunctionCall const& _call)
|
||||
}
|
||||
|
||||
Scope::Function* function = nullptr;
|
||||
solAssert(m_scope->lookup(_call.functionName.name, Scope::NonconstVisitor(
|
||||
solAssert(m_scope->lookup(_call.functionName.name, GenericVisitor{
|
||||
[=](Scope::Variable&) { solAssert(false, "Expected function name."); },
|
||||
[=](Scope::Label&) { solAssert(false, "Expected function name."); },
|
||||
[&](Scope::Function& _function) { function = &_function; }
|
||||
)), "Function name not found.");
|
||||
}), "Function name not found.");
|
||||
solAssert(function, "");
|
||||
solAssert(function->arguments.size() == _call.arguments.size(), "");
|
||||
for (auto const& arg: _call.arguments | boost::adaptors::reversed)
|
||||
@@ -310,7 +310,7 @@ void CodeTransform::operator()(Identifier const& _identifier)
|
||||
m_assembly.setSourceLocation(_identifier.location);
|
||||
// First search internals, then externals.
|
||||
solAssert(m_scope, "");
|
||||
if (m_scope->lookup(_identifier.name, Scope::NonconstVisitor(
|
||||
if (m_scope->lookup(_identifier.name, GenericVisitor{
|
||||
[=](Scope::Variable& _var)
|
||||
{
|
||||
// TODO: opportunity for optimization: Do not DUP if this is the last reference
|
||||
@@ -330,7 +330,7 @@ void CodeTransform::operator()(Identifier const& _identifier)
|
||||
{
|
||||
solAssert(false, "Function not removed during desugaring.");
|
||||
}
|
||||
)))
|
||||
}))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -646,14 +646,14 @@ void CodeTransform::operator()(Block const& _block)
|
||||
AbstractAssembly::LabelID CodeTransform::labelFromIdentifier(Identifier const& _identifier)
|
||||
{
|
||||
AbstractAssembly::LabelID label = AbstractAssembly::LabelID(-1);
|
||||
if (!m_scope->lookup(_identifier.name, Scope::NonconstVisitor(
|
||||
if (!m_scope->lookup(_identifier.name, GenericVisitor{
|
||||
[=](Scope::Variable&) { solAssert(false, "Expected label"); },
|
||||
[&](Scope::Label& _label)
|
||||
{
|
||||
label = labelID(_label);
|
||||
},
|
||||
[=](Scope::Function&) { solAssert(false, "Expected label"); }
|
||||
)))
|
||||
}))
|
||||
{
|
||||
solAssert(false, "Identifier not found.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user