aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-01-10 01:30:14 +0800
committerchriseth <chris@ethereum.org>2018-01-10 21:16:46 +0800
commit8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b (patch)
tree24ae6722975b86c4702d12feb825f3e3aa8663c5 /libsolidity
parent42f88757708c42f447572c9b96da06c06329e9bc (diff)
downloaddexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.tar
dexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.tar.gz
dexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.tar.bz2
dexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.tar.lz
dexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.tar.xz
dexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.tar.zst
dexon-solidity-8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b.zip
Disallow non-functional instructions in parseExpression early
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index 88a0afc1..306b07e6 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -265,10 +265,13 @@ assembly::Expression Parser::parseExpression()
instructionNames().at(instr.instruction) +
"\" not allowed in this context."
);
+ if (m_flavour != AsmFlavour::Loose && currentToken() != Token::LParen)
+ fatalParserError(
+ "Non-functional instructions are not allowed in this context."
+ );
// Enforce functional notation for instructions requiring multiple arguments.
int args = instructionInfo(instr.instruction).args;
- bool requireFunctionalNotation = (args > 0 || m_flavour != AsmFlavour::Loose);
- if (requireFunctionalNotation && currentToken() != Token::LParen)
+ if (args > 0 && currentToken() != Token::LParen)
fatalParserError(string(
"Expected token \"(\" (\"" +
instructionNames().at(instr.instruction) +