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

ruby-changes:37711

From: nobu <ko1@a...>
Date: Sun, 1 Mar 2015 11:18:06 +0900 (JST)
Subject: [ruby-changes:37711] nobu:r49792 (trunk): gc.c: hide internal objects

nobu	2015-03-01 11:18:00 +0900 (Sun, 01 Mar 2015)

  New Revision: 49792

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

  Log:
    gc.c: hide internal objects
    
    * gc.c (id2ref): prohibit from accessing internal objects.
      [ruby-core:68348] [Bug #10918]

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49791)
+++ ChangeLog	(revision 49792)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Mar  1 11:17:56 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* gc.c (id2ref): prohibit from accessing internal objects.
+	  [ruby-core:68348] [Bug #10918]
+
 Sun Mar  1 09:06:11 2015  Tanaka Akira  <akr@f...>
 
 	* lib/time.rb (strptime): Support %s.%N.
Index: gc.c
===================================================================
--- gc.c	(revision 49791)
+++ gc.c	(revision 49792)
@@ -2761,6 +2761,9 @@ id2ref(VALUE obj, VALUE objid) https://github.com/ruby/ruby/blob/trunk/gc.c#L2761
     if (!is_live_object(objspace, ptr)) {
 	rb_raise(rb_eRangeError, "%p is recycled object", p0);
     }
+    if (RBASIC(ptr)->klass == 0) {
+	rb_raise(rb_eRangeError, "%p is internal object", p0);
+    }
     return (VALUE)ptr;
 }
 

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

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