From 079161e1ba535da34a4a30179d606390346cdda1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 28 Aug 2024 16:17:02 -0400 Subject: [PATCH] [PRISM] Respect PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING flag --- prism_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prism_compile.c b/prism_compile.c index c50f8e1aad..e2f123c810 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -505,7 +505,7 @@ parse_regexp_flags(const pm_node_t *node) static rb_encoding * parse_regexp_encoding(const pm_scope_node_t *scope_node, const pm_node_t *node) { - if (PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT)) { + if (PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING) || PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT)) { return rb_ascii8bit_encoding(); } else if (PM_NODE_FLAG_P(node, PM_REGULAR_EXPRESSION_FLAGS_UTF_8)) {