diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 7f36746d3..89f769420 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -744,13 +744,6 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly) bool ) -> bool { - if (_context == yul::IdentifierContext::NonExternal) - { - // Hack until we can disallow any shadowing: If we found an internal reference, - // clear the external references, so that codegen does not use it. - _inlineAssembly.annotation().externalReferences.erase(& _identifier); - return false; - } auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier); if (ref == _inlineAssembly.annotation().externalReferences.end()) return false; diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp index 1c0867568..f7378463a 100644 --- a/libyul/AsmAnalysis.cpp +++ b/libyul/AsmAnalysis.cpp @@ -146,13 +146,6 @@ vector AsmAnalyzer::operator()(Identifier const& _identifier) } })) { - if (m_resolver) - // We found a local reference, make sure there is no external reference. - m_resolver( - _identifier, - yul::IdentifierContext::NonExternal, - m_currentScope->insideFunction() - ); } else { @@ -315,7 +308,7 @@ vector AsmAnalyzer::operator()(FunctionCall const& _funCall) validateInstructions(_funCall); } - else if (m_currentScope->lookup(_funCall.functionName.name, GenericVisitor{ + else if (!m_currentScope->lookup(_funCall.functionName.name, GenericVisitor{ [&](Scope::Variable const&) { m_errorReporter.typeError( @@ -330,15 +323,6 @@ vector AsmAnalyzer::operator()(FunctionCall const& _funCall) returnTypes = &_fun.returns; } })) - { - if (m_resolver) - // We found a local reference, make sure there is no external reference. - m_resolver( - _funCall.functionName, - yul::IdentifierContext::NonExternal, - m_currentScope->insideFunction() - ); - } else { if (!validateInstructions(_funCall)) @@ -556,14 +540,6 @@ void AsmAnalyzer::checkAssignment(Identifier const& _variable, YulString _valueT bool found = false; if (Scope::Identifier const* var = m_currentScope->lookup(_variable.name)) { - if (m_resolver) - // We found a local reference, make sure there is no external reference. - m_resolver( - _variable, - yul::IdentifierContext::NonExternal, - m_currentScope->insideFunction() - ); - if (!holds_alternative(*var)) m_errorReporter.typeError(2657_error, _variable.debugData->location, "Assignment requires variable."); else if (!m_activeVariables.count(&std::get(*var))) diff --git a/libyul/backends/evm/AbstractAssembly.h b/libyul/backends/evm/AbstractAssembly.h index 60a745bee..9e1a28dab 100644 --- a/libyul/backends/evm/AbstractAssembly.h +++ b/libyul/backends/evm/AbstractAssembly.h @@ -117,7 +117,7 @@ public: virtual void markAsInvalid() = 0; }; -enum class IdentifierContext { LValue, RValue, VariableDeclaration, NonExternal }; +enum class IdentifierContext { LValue, RValue, VariableDeclaration }; /// Object that is used to resolve references and generate code for access to identifiers external /// to inline assembly (not used in standalone assembly mode).