mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2384 from ethereum/parseFunctionalInstructions
Enforce function arguments when parsing functional instructions.
This commit is contained in:
@@ -174,6 +174,19 @@ assembly::Case Parser::parseCase()
|
||||
assembly::Statement Parser::parseExpression()
|
||||
{
|
||||
Statement operation = parseElementaryOperation(true);
|
||||
if (operation.type() == typeid(Instruction))
|
||||
{
|
||||
Instruction const& instr = boost::get<Instruction>(operation);
|
||||
int args = instructionInfo(instr.instruction).args;
|
||||
if (args > 0 && currentToken() != Token::LParen)
|
||||
fatalParserError(string(
|
||||
"Expected token \"(\" (\"" +
|
||||
instructionNames().at(instr.instruction) +
|
||||
"\" expects " +
|
||||
boost::lexical_cast<string>(args) +
|
||||
" arguments)"
|
||||
));
|
||||
}
|
||||
if (currentToken() == Token::LParen)
|
||||
return parseCall(std::move(operation));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user