mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
AsmAnalyzer: Improve warnOnInstructions(...) implementation.
This commit is contained in:
parent
2390b1bfd4
commit
ee5826b261
@ -678,10 +678,9 @@ std::map<string, dev::eth::Instruction> const& instructions()
|
|||||||
|
|
||||||
bool AsmAnalyzer::warnOnInstructions(std::string const& _instructionIdentifier, langutil::SourceLocation const& _location)
|
bool AsmAnalyzer::warnOnInstructions(std::string const& _instructionIdentifier, langutil::SourceLocation const& _location)
|
||||||
{
|
{
|
||||||
auto const& instructionMap = instructions();
|
auto const builtin = EVMDialect::strictAssemblyForEVM(EVMVersion{}).builtin(YulString(_instructionIdentifier));
|
||||||
auto const identifier = boost::to_lower_copy(_instructionIdentifier);
|
if (builtin)
|
||||||
if (auto const i = instructionMap.find(identifier); i != instructionMap.end())
|
return warnOnInstructions(builtin->instruction.get(), _location);
|
||||||
return warnOnInstructions(i->second, _location);
|
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user