aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmScopeFiller.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-04-12 02:19:37 +0800
committerchriseth <chris@ethereum.org>2017-04-25 22:49:03 +0800
commitb622c2e9d3d13c4c9061488abbe795994e94cfcf (patch)
treeea289f5d868848407f5db274a59513fc6acacd7c /libsolidity/inlineasm/AsmScopeFiller.cpp
parent34717838da875c5265f005bb92c3349c08063ba5 (diff)
downloaddexon-solidity-b622c2e9d3d13c4c9061488abbe795994e94cfcf.tar.gz
dexon-solidity-b622c2e9d3d13c4c9061488abbe795994e94cfcf.tar.zst
dexon-solidity-b622c2e9d3d13c4c9061488abbe795994e94cfcf.zip
Only run stack filler on AST elements that are or contain declarations.
Diffstat (limited to 'libsolidity/inlineasm/AsmScopeFiller.cpp')
-rw-r--r--libsolidity/inlineasm/AsmScopeFiller.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/libsolidity/inlineasm/AsmScopeFiller.cpp b/libsolidity/inlineasm/AsmScopeFiller.cpp
index 66a217ea..de6fbdaa 100644
--- a/libsolidity/inlineasm/AsmScopeFiller.cpp
+++ b/libsolidity/inlineasm/AsmScopeFiller.cpp
@@ -46,17 +46,6 @@ ScopeFiller::ScopeFiller(ScopeFiller::Scopes& _scopes, ErrorList& _errors):
m_currentScope = &scope(nullptr);
}
-bool ScopeFiller::operator()(FunctionalInstruction const& _instr)
-{
- bool success = true;
- for (auto const& arg: _instr.arguments | boost::adaptors::reversed)
- if (!boost::apply_visitor(*this, arg))
- success = false;
- if (!(*this)(_instr.instruction))
- success = false;
- return success;
-}
-
bool ScopeFiller::operator()(Label const& _item)
{
if (!m_currentScope->registerLabel(_item.name))
@@ -72,17 +61,9 @@ bool ScopeFiller::operator()(Label const& _item)
return true;
}
-bool ScopeFiller::operator()(FunctionalAssignment const& _assignment)
-{
- return boost::apply_visitor(*this, *_assignment.value);
-}
-
bool ScopeFiller::operator()(assembly::VariableDeclaration const& _varDecl)
{
- bool success = boost::apply_visitor(*this, *_varDecl.value);
- if (!registerVariable(_varDecl.name, _varDecl.location, *m_currentScope))
- success = false;
- return success;
+ return registerVariable(_varDecl.name, _varDecl.location, *m_currentScope);
}
bool ScopeFiller::operator()(assembly::FunctionDefinition const& _funDef)
@@ -111,15 +92,6 @@ bool ScopeFiller::operator()(assembly::FunctionDefinition const& _funDef)
return success;
}
-bool ScopeFiller::operator()(assembly::FunctionCall const& _funCall)
-{
- bool success = true;
- for (auto const& arg: _funCall.arguments | boost::adaptors::reversed)
- if (!boost::apply_visitor(*this, arg))
- success = false;
- return success;
-}
-
bool ScopeFiller::operator()(Block const& _block)
{
bool success = true;