GC guard current_string in the putobject instruction

This is a band-aid solution for #11655 that only applies the fix for the
putobject instruction before the objtostring instruction.

This should help fix the use-after-poison in the ASAN CI.

http://ci.rvm.jp/logfiles/brlog.trunk_asan.20240920-082802
This commit is contained in:
Peter Zhu 2024-09-20 12:34:28 -04:00
parent 54a21851fe
commit 69f28ab715
Notes: git 2024-09-20 17:07:57 +00:00

View File

@ -646,7 +646,9 @@ pm_interpolated_node_compile(rb_iseq_t *iseq, const pm_node_list_t *parts, const
current_string = rb_enc_str_new(NULL, 0, encoding);
}
PUSH_INSN1(ret, current_location, putobject, rb_fstring(current_string));
current_string = rb_fstring(current_string);
PUSH_INSN1(ret, current_location, putobject, current_string);
RB_GC_GUARD(current_string);
PM_COMPILE_NOT_POPPED(part);
const pm_node_location_t current_location = PM_NODE_START_LOCATION(scope_node->parser, part);