[前][次][番号順一覧][スレッド一覧]

ruby-changes:55211

From: tenderlove <ko1@a...>
Date: Wed, 3 Apr 2019 04:13:25 +0900 (JST)
Subject: [ruby-changes:55211] tenderlove:r67417 (trunk): Fix ASAN error

tenderlove	2019-04-03 04:13:12 +0900 (Wed, 03 Apr 2019)

  New Revision: 67417

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67417

  Log:
    Fix ASAN error
    
    This code was trying to access memory before unpoisoning it.

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 67416)
+++ gc.c	(revision 67417)
@@ -2630,8 +2630,8 @@ internal_object_p(VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L2630
 {
     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)) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]