diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp index cd3ea0da2..048d916dd 100644 --- a/libsolidity/inlineasm/AsmParser.cpp +++ b/libsolidity/inlineasm/AsmParser.cpp @@ -130,7 +130,7 @@ assembly::Statement Parser::parseExpression() return operation; } -std::map Parser::getInstructions() +std::map const& Parser::instructions() { // Allowed instructions, lowercase names. static map s_instructions; @@ -156,7 +156,7 @@ std::map Parser::getInstructions() assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher) { - map s_instructions = getInstructions(); + map const& s_instructions = instructions(); Statement ret; switch (m_scanner->currentToken()) @@ -178,7 +178,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher) // first search the set of instructions. if (s_instructions.count(literal)) { - dev::solidity::Instruction const& instr = s_instructions[literal]; + dev::solidity::Instruction const& instr = s_instructions.at(literal); if (_onlySinglePusher) { InstructionInfo info = dev::solidity::instructionInfo(instr); @@ -210,7 +210,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher) assembly::VariableDeclaration Parser::parseVariableDeclaration() { - map s_instructions = getInstructions(); + map const& s_instructions = instructions(); VariableDeclaration varDecl = createWithLocation(); expectToken(Token::Let); varDecl.name = m_scanner->currentLiteral(); diff --git a/libsolidity/inlineasm/AsmParser.h b/libsolidity/inlineasm/AsmParser.h index 764c53f66..643548dd0 100644 --- a/libsolidity/inlineasm/AsmParser.h +++ b/libsolidity/inlineasm/AsmParser.h @@ -64,7 +64,7 @@ protected: Statement parseStatement(); /// Parses a functional expression that has to push exactly one stack element Statement parseExpression(); - std::map getInstructions(); + std::map const& instructions(); Statement parseElementaryOperation(bool _onlySinglePusher = false); VariableDeclaration parseVariableDeclaration(); FunctionalInstruction parseFunctionalInstruction(Statement&& _instruction);