summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-01 02:18:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-01 02:18:00 +0000
commit9334597b11de6f792ef458ae88ff55f1415d64a7 (patch)
tree1e854707d3dbcaa04f8beb243e0f667227961552 /gc.c
parentcb0cfbb4c399846f443ced842ac952b7f60198f4 (diff)
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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index c84da503ea..b843e7bb73 100644
--- a/gc.c
+++ b/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;
}