Fix ASan crash
This commit is contained in:
parent
04fddf3573
commit
0213f5b08a
Notes:
git
2020-06-11 08:37:11 +09:00
6
gc.c
6
gc.c
@ -11514,6 +11514,8 @@ const char *
|
|||||||
rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
|
rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
|
||||||
{
|
{
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
void *poisoned = asan_poisoned_object_p(obj);
|
||||||
|
asan_unpoison_object(obj, false);
|
||||||
|
|
||||||
#define BUFF_ARGS buff + pos, buff_size - pos
|
#define BUFF_ARGS buff + pos, buff_size - pos
|
||||||
#define APPENDF(f) if ((pos += snprintf f) >= buff_size) goto end
|
#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
|
#undef C
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
|
if (poisoned) {
|
||||||
|
asan_poison_object(obj);
|
||||||
|
}
|
||||||
|
|
||||||
return buff;
|
return buff;
|
||||||
#undef APPENDF
|
#undef APPENDF
|
||||||
#undef BUFF_ARGS
|
#undef BUFF_ARGS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user