From 56fe3a6ab93116438ea52634e891c71b995d7c3f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 May 2017 13:13:05 +0100 Subject: Better error messages during parsing functional instructions --- libsolidity/inlineasm/AsmParser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libsolidity') diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp index 85ae9424..519bfa2e 100644 --- a/libsolidity/inlineasm/AsmParser.cpp +++ b/libsolidity/inlineasm/AsmParser.cpp @@ -321,6 +321,15 @@ assembly::Statement Parser::parseCall(assembly::Statement&& _instruction) unsigned args = unsigned(instrInfo.args); for (unsigned i = 0; i < args; ++i) { + /// check for premature closing parentheses + if (m_scanner->currentToken() == Token::RParen) + fatalParserError(string( + "Expected " + + boost::lexical_cast(args) + + " arguments, but received " + + boost::lexical_cast(i) + )); + ret.arguments.emplace_back(parseExpression()); if (i != args - 1) { -- cgit