From f06670c5a2a1daa6595018858d5cfa429a8aeae6 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 16 Apr 2024 15:30:00 +0200 Subject: Eliminate usage of OBJ_FREEZE_RAW Previously it would bypass the `FL_ABLE` check, but since shapes introduction, it started having a different behavior than `OBJ_FREEZE`, as it would onyl set the `FL_FREEZE` flag, but not update the shape. I have no indication of this causing a bug yet, but it seems like a trap waiting to happen. --- thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 196f9092b4..b8ba61e188 100644 --- a/thread.c +++ b/thread.c @@ -2281,7 +2281,7 @@ rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg) mask = mask_arg; } else if (RB_TYPE_P(mask, T_HASH)) { - OBJ_FREEZE_RAW(mask); + OBJ_FREEZE(mask); } rb_ary_push(th->pending_interrupt_mask_stack, mask); @@ -5846,7 +5846,7 @@ rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data) rb_thread_t *cur_th = GET_THREAD(); rb_hash_aset(interrupt_mask, rb_cObject, sym_never); - OBJ_FREEZE_RAW(interrupt_mask); + OBJ_FREEZE(interrupt_mask); rb_ary_push(cur_th->pending_interrupt_mask_stack, interrupt_mask); VALUE ret = rb_ensure(b_proc, data, uninterruptible_exit, Qnil); -- cgit v1.2.3