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

Fix ASAN error

This code was trying to access memory before unpoisoning it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2019-04-02 19:13:12 +00:00
parent 4283fb42bc
commit e377eb0e75

2
gc.c
View file

@ -2630,8 +2630,8 @@ internal_object_p(VALUE obj)
{
RVALUE *p = (RVALUE *)obj;
void *ptr = __asan_region_is_poisoned(p, SIZEOF_VALUE);
bool used_p = p->as.basic.flags;
unpoison_object(obj, false);
bool used_p = p->as.basic.flags;
if (used_p) {
switch (BUILTIN_TYPE(p)) {