1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add NULL check.

DATA_PTR(ractor) can be NULL just after creation.
This commit is contained in:
Koichi Sasada 2020-10-03 23:22:17 +09:00
parent d0778cb264
commit 0406898a3f

4
gc.c
View file

@ -11955,7 +11955,9 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
}
else if (rb_ractor_p(obj)) {
rb_ractor_t *r = (void *)DATA_PTR(obj);
APPENDF((BUFF_ARGS, "r:%d", r->id));
if (r) {
APPENDF((BUFF_ARGS, "r:%d", r->id));
}
}
else {
const char * const type_name = rb_objspace_data_type_name(obj);