diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-21 00:49:44 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-21 00:49:44 +0000 |
commit | bf8a18ac9a19b78a968e0ecd217f0c64d7c2d24e (patch) | |
tree | 2a1bf1f427ff9899ab1061cbaac944228834821c /gc.c | |
parent | f1cb00f82ec567b4d61df0435fbc357efeb7cc00 (diff) |
merge revision(s) 49792: [Backport #10918]
* gc.c (id2ref): prohibit from accessing internal objects.
[ruby-core:68348] [Bug #10918]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2332,6 +2332,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; } |