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 /libsolidity/inlineasm/AsmParser.cpp | |
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
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmParser.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |