From 61829eec657e8271f05a74f2067b4203ba0a51a2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 8 May 2024 12:38:42 -0400 Subject: [ruby/prism] Ensure keyword parameters do not end in ! or ? https://github.com/ruby/prism/commit/57d86a8545 --- prism/prism.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prism/prism.c b/prism/prism.c index 97fa30e4bd..6ae32825eb 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -14326,6 +14326,10 @@ parse_parameters( pm_token_t local = name; local.end -= 1; + if (local.end[-1] == '!' || local.end[-1] == '?') { + PM_PARSER_ERR_TOKEN_FORMAT_CONTENT(parser, local, PM_ERR_INVALID_LOCAL_VARIABLE_WRITE); + } + bool repeated = pm_parser_parameter_name_check(parser, &local); pm_parser_local_add_token(parser, &local, 1); -- cgit v1.2.3