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

gc.c: hide internal objects

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-03-01 02:18:00 +00:00
parent cb0cfbb4c3
commit 9334597b11
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Sun Mar 1 11:17:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (id2ref): prohibit from accessing internal objects.
[ruby-core:68348] [Bug #10918]
Sun Mar 1 09:06:11 2015 Tanaka Akira <akr@fsij.org>
* lib/time.rb (strptime): Support %s.%N.

3
gc.c
View file

@ -2761,6 +2761,9 @@ id2ref(VALUE obj, VALUE objid)
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;
}