aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-24 20:13:05 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-24 20:35:52 +0800
commit56fe3a6ab93116438ea52634e891c71b995d7c3f (patch)
treef45ffcd9d895c9728445d30d56aeb1c71c94d44f /libsolidity
parent451acd4c9f118a299e627d574dee1785d870723a (diff)
downloaddexon-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')
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp9
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)
{