From 8e7d2cc2ab55339b946025f01f52b1795dab3e1a Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 3 Feb 2023 15:20:44 +0100 Subject: [PATCH] Implement Write Barrier for Backtrace::Location It only has a single reference, set in a single place. --- vm_backtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm_backtrace.c b/vm_backtrace.c index e50611c7bb..3d0b32e7e1 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -165,7 +165,7 @@ location_memsize(const void *ptr) static const rb_data_type_t location_data_type = { "frame_info", {location_mark, RUBY_TYPED_DEFAULT_FREE, location_memsize,}, - 0, 0, RUBY_TYPED_FREE_IMMEDIATELY + 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED }; int @@ -757,7 +757,7 @@ location_create(rb_backtrace_location_t *srcloc, void *btobj) obj = TypedData_Make_Struct(rb_cBacktraceLocation, struct valued_frame_info, &location_data_type, vloc); vloc->loc = srcloc; - vloc->btobj = (VALUE)btobj; + RB_OBJ_WRITE(obj, &vloc->btobj, (VALUE)btobj); return obj; }