mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow instructions as a switch expression
This commit is contained in:
@@ -72,6 +72,8 @@ assembly::Statement Parser::parseStatement()
|
||||
assembly::Switch _switch = createWithLocation<assembly::Switch>();
|
||||
m_scanner->next();
|
||||
_switch.expression = make_shared<Statement>(parseExpression());
|
||||
if (_switch.expression->type() == typeid(assembly::Instruction))
|
||||
fatalParserError("Instructions are not supported as expressions for switch.");
|
||||
while (m_scanner->currentToken() == Token::Case)
|
||||
_switch.cases.emplace_back(parseCase());
|
||||
if (m_scanner->currentToken() == Token::Default)
|
||||
|
||||
Reference in New Issue
Block a user