From d86b4041b5eca43eea581e4af874e3fd46faaaa2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 1 Oct 2024 09:45:09 -0400 Subject: [PATCH] [ruby/prism] Disallow empty labels when not allowed https://github.com/ruby/prism/commit/399ee28dc1 --- prism/prism.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prism/prism.c b/prism/prism.c index 4bbcf0ea9d..a99fb712e3 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -16545,6 +16545,8 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 pm_string_shared_init(&symbol->unescaped, content.start, content.end); node = (pm_node_t *) symbol; + + if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else if (!lex_interpolation) { // If we don't accept interpolation then we expect the string to // start with a single string content node.