Skip to content

Commit 774eef6

Browse files
Always freeze strings that are in the instructions
Any objects that the instructions reference should be frozen. Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
1 parent a0a100d commit 774eef6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prism_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ pm_interpolated_node_compile(pm_node_list_t *parts, rb_iseq_t *iseq, NODE dummy_
757757
ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string));
758758
}
759759
else {
760-
ADD_INSN1(ret, &dummy_line_node, putstring, current_string);
760+
ADD_INSN1(ret, &dummy_line_node, putstring, rb_str_freeze(current_string));
761761
}
762762
current_string = Qnil;
763763
number_of_items_pushed++;
@@ -776,7 +776,7 @@ pm_interpolated_node_compile(pm_node_list_t *parts, rb_iseq_t *iseq, NODE dummy_
776776
ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string));
777777
}
778778
else {
779-
ADD_INSN1(ret, &dummy_line_node, putstring, current_string);
779+
ADD_INSN1(ret, &dummy_line_node, putstring, rb_str_freeze(current_string));
780780
}
781781
current_string = Qnil;
782782
number_of_items_pushed++;

0 commit comments

Comments
 (0)