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

ruby-changes:29155

From: ko1 <ko1@a...>
Date: Mon, 10 Jun 2013 16:12:44 +0900 (JST)
Subject: [ruby-changes:29155] ko1:r41207 (trunk): * gc.c (wmap_mark): check allocation of `w->obj2wmap'.

ko1	2013-06-10 16:12:14 +0900 (Mon, 10 Jun 2013)

  New Revision: 41207

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41207

  Log:
    * gc.c (wmap_mark): check allocation of `w->obj2wmap'.
      (no-allocation `w->obj2wmap' will be NULL pointer reference)

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41206)
+++ ChangeLog	(revision 41207)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jun 10 16:05:59 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (wmap_mark): check allocation of `w->obj2wmap'.
+	  (no-allocation `w->obj2wmap' will be NULL pointer reference)
+
 Mon Jun 10 15:36:00 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* eval_error.c (error_print): use checking functions instead of
Index: gc.c
===================================================================
--- gc.c	(revision 41206)
+++ gc.c	(revision 41207)
@@ -4613,7 +4613,7 @@ static void https://github.com/ruby/ruby/blob/trunk/gc.c#L4613
 wmap_mark(void *ptr)
 {
     struct weakmap *w = ptr;
-    st_foreach(w->obj2wmap, wmap_mark_map, (st_data_t)&rb_objspace);
+    if (w->obj2wmap) st_foreach(w->obj2wmap, wmap_mark_map, (st_data_t)&rb_objspace);
     rb_gc_mark(w->final);
 }
 

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

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