8d1a6bc48b (master): gc.c: check if the struct has fields before marking the fields_obj

0 views
Skip to first unread message

Jean Boussier

unread,
3:15 PM (4 hours ago) 3:15 PM
to ruby...@g.ruby-lang.org
Jean Boussier 2025-12-03 19:40:22 +0000 (Wed, 03 Dec 2025)

New Revision: 8d1a6bc48b

https://github.com/ruby/ruby/commit/8d1a6bc48b

Log:
gc.c: check if the struct has fields before marking the fields_obj

If GC trigger in the middle of `struct_alloc`, and the struct has more
than 3 elements, then `fields_obj` reference is garbage.

We must first check the shape to know if it was actually initialized.

Modified files:
gc.c
Reply all
Reply to author
Forward
0 new messages