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:
parent
04fddf3573
commit
0213f5b08a
Notes:
git
2020-06-11 08:37:11 +09:00
1 changed files with 6 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue