diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-24 20:13:05 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-24 20:35:52 +0800 |
commit | 56fe3a6ab93116438ea52634e891c71b995d7c3f (patch) | |
tree | f45ffcd9d895c9728445d30d56aeb1c71c94d44f | |
parent | 451acd4c9f118a299e627d574dee1785d870723a (diff) | |
download | dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.tar dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.tar.gz dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.tar.bz2 dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.tar.lz dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.tar.xz dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.tar.zst dexon-solidity-56fe3a6ab93116438ea52634e891c71b995d7c3f.zip |
Better error messages during parsing functional instructions
-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) { |