Analyze inline assembly variable declarations for invalid or shadowing names.

This commit is contained in:
Daniel Kirchner
2019-11-07 13:04:37 +01:00
parent 30ea41c36d
commit 0556f64722
14 changed files with 154 additions and 3 deletions
+8
View File
@@ -244,6 +244,14 @@ bool AsmAnalyzer::operator()(VariableDeclaration const& _varDecl)
{
bool success = true;
int const numVariables = _varDecl.variables.size();
if (m_resolver)
for (auto const& variable: _varDecl.variables)
// Call the resolver for variable declarations to allow it to raise errors on shadowing.
m_resolver(
yul::Identifier{variable.location, variable.name},
yul::IdentifierContext::VariableDeclaration,
m_currentScope->insideFunction()
);
if (_varDecl.value)
{
int const stackHeight = m_stackHeight;