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:
parent
cb0cfbb4c3
commit
9334597b11
2 changed files with 8 additions and 0 deletions
|
@ -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
3
gc.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue