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

Fix ASan crash

This commit is contained in:
Peter Zhu 2020-06-10 10:17:56 -04:00 committed by Aaron Patterson
parent 04fddf3573
commit 0213f5b08a
Notes: git 2020-06-11 08:37:11 +09:00

6
gc.c
View file

@ -11514,6 +11514,8 @@ const char *
rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
{
int pos = 0;
void *poisoned = asan_poisoned_object_p(obj);
asan_unpoison_object(obj, false);
#define BUFF_ARGS buff + pos, buff_size - pos
#define APPENDF(f) if ((pos += snprintf f) >= buff_size) goto end
@ -11744,6 +11746,10 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
#undef C
}
end:
if (poisoned) {
asan_poison_object(obj);
}
return buff;
#undef APPENDF
#undef BUFF_ARGS