Add missing RB_GC_GUARDs related to DATA_PTR
I discovered the problem in `compile.c` from a failing TestIseqLoad#test_stressful_roundtrip test with ASAN enabled. The other two changes in array.c and string.c I found by auditing similar usages of DATA_PTR in the codebase. [Bug #20402]
This commit is contained in:
parent
174b671699
commit
9d0a5148ae
1
array.c
1
array.c
@ -6643,6 +6643,7 @@ ary_sample(rb_execution_context_t *ec, VALUE ary, VALUE randgen, VALUE nv, VALUE
|
||||
});
|
||||
DATA_PTR(vmemo) = 0;
|
||||
st_free_table(memo);
|
||||
RB_GC_GUARD(vmemo);
|
||||
}
|
||||
else {
|
||||
result = rb_ary_dup(ary);
|
||||
|
@ -11318,6 +11318,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
|
||||
}
|
||||
}
|
||||
DATA_PTR(labels_wrapper) = 0;
|
||||
RB_GC_GUARD(labels_wrapper);
|
||||
validate_labels(iseq, labels_table);
|
||||
if (!ret) return ret;
|
||||
return iseq_setup(iseq, anchor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user