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:
parent
d0778cb264
commit
0406898a3f
1 changed files with 3 additions and 1 deletions
4
gc.c
4
gc.c
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue