From 774eef692cc9708b22959ef57b8472a375772189 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 8 Jan 2024 13:32:35 -0800 Subject: [PATCH] Always freeze strings that are in the instructions Any objects that the instructions reference should be frozen. Co-Authored-By: Matt Valentine-House --- prism_compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prism_compile.c b/prism_compile.c index c87f57f78a..5006ce50e8 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -757,7 +757,7 @@ pm_interpolated_node_compile(pm_node_list_t *parts, rb_iseq_t *iseq, NODE dummy_ ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string)); } else { - ADD_INSN1(ret, &dummy_line_node, putstring, current_string); + ADD_INSN1(ret, &dummy_line_node, putstring, rb_str_freeze(current_string)); } current_string = Qnil; number_of_items_pushed++; @@ -776,7 +776,7 @@ pm_interpolated_node_compile(pm_node_list_t *parts, rb_iseq_t *iseq, NODE dummy_ ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string)); } else { - ADD_INSN1(ret, &dummy_line_node, putstring, current_string); + ADD_INSN1(ret, &dummy_line_node, putstring, rb_str_freeze(current_string)); } current_string = Qnil; number_of_items_pushed++;