diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-01 02:18:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-01 02:18:00 +0000 |
commit | 9334597b11de6f792ef458ae88ff55f1415d64a7 (patch) | |
tree | 1e854707d3dbcaa04f8beb243e0f667227961552 /gc.c | |
parent | cb0cfbb4c399846f443ced842ac952b7f60198f4 (diff) | |
download | ruby-9334597b11de6f792ef458ae88ff55f1415d64a7.tar.gz |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } |