Disallow usage of the indexed attribute for modifier parameters Added tests for edge cases of several keywords

This commit is contained in:
vlad 2022-12-25 20:14:23 +04:00 committed by Kamil Śliwak
parent 6a0ea174b8
commit 7fbd36855d
3 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@ Compiler Features:
Bugfixes: Bugfixes:
* Parser: Disallow several ``indexed`` attributes for the same event parameter. * Parser: Disallow several ``indexed`` attributes for the same event parameter.
* Parser: Disallow usage of the ``indexed`` attribute for modifier parameters.
* Yul Optimizer: Hash hex and decimal literals according to their value instead of their representation, improving the detection of equivalent functions. * Yul Optimizer: Hash hex and decimal literals according to their value instead of their representation, improving the detection of equivalent functions.
* Solidity Upgrade Tool ``solidity-upgrade``: Fix the tool returning success code on uncaught exceptions. * Solidity Upgrade Tool ``solidity-upgrade``: Fix the tool returning success code on uncaught exceptions.
* SMTChecker: Fix display error for negative integers that are one more than powers of two. * SMTChecker: Fix display error for negative integers that are one more than powers of two.

View File

@ -879,7 +879,6 @@ ASTPointer<ModifierDefinition> Parser::parseModifierDefinition()
if (m_scanner->currentToken() == Token::LParen) if (m_scanner->currentToken() == Token::LParen)
{ {
VarDeclParserOptions options; VarDeclParserOptions options;
options.allowIndexed = true;
options.allowLocationSpecifier = true; options.allowLocationSpecifier = true;
parameters = parseParameterList(options); parameters = parseParameterList(options);
} }

View File

@ -0,0 +1,5 @@
contract B {
modifier mod1(uint indexed a) { _; }
}
// ----
// ParserError 2314: (36-43): Expected ',' but got 'indexed'