diff options
-rw-r--r-- | Changelog.md | 4 | ||||
-rw-r--r-- | libsolidity/inlineasm/AsmParser.cpp | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Changelog.md b/Changelog.md index 2073c0a4..5ba712f5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ ### 0.4.12 (unreleased) + +Features: * AST: export all attributes to Json format + * Inline Assembly: Present proper error message when not supplying enough arguments to a functional + instruction. Bugfixes: * Unused variable warnings no longer issued for variables used inside inline assembly 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<string>(args) + + " arguments, but received " + + boost::lexical_cast<string>(i) + )); + ret.arguments.emplace_back(parseExpression()); if (i != args - 1) { |