* gc.c (id2ref): T_VALUES is less than T_BLOCK. [ruby-dev:31911]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-10-01 06:17:50 +00:00
Родитель 014d1ae20d
Коммит 7d0787116d
4 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Mon Oct 1 15:17:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (id2ref): T_VALUES is less than T_BLOCK. [ruby-dev:31911]
Mon Oct 1 10:58:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (require_libraries): use require method instead of calling

Просмотреть файл

@ -33,20 +33,6 @@ assert_normal_exit %q{
Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| })
}
assert_normal_exit %q{
eval("", TOPLEVEL_BINDING)
minobj = ObjectSpace.to_enum(:each_object).min {|a,b| a.object_id <=> b.object_id }
maxobj = ObjectSpace.to_enum(:each_object).max {|a,b| a.object_id <=> b.object_id }
minobj.object_id.upto(maxobj.object_id) {|id|
begin
o = ObjectSpace._id2ref(id)
rescue RangeError
next
end
o.inspect
}
}, '[ruby-dev:31911]'
assert_normal_exit %q{
require 'continuation'
Fiber.new{ callcc{|c| @c = c } }.resume

Просмотреть файл

@ -0,0 +1,13 @@
assert_normal_exit %q{
eval("", TOPLEVEL_BINDING)
minobj = ObjectSpace.to_enum(:each_object).min_by {|a| a.object_id }
maxobj = ObjectSpace.to_enum(:each_object).max_by {|a| a.object_id }
minobj.object_id.upto(maxobj.object_id) {|id|
begin
o = ObjectSpace._id2ref(id)
rescue RangeError
next
end
o.inspect if defined?(o.inspect)
}
}, '[ruby-dev:31911]'

2
gc.c
Просмотреть файл

@ -2069,7 +2069,7 @@ id2ref(VALUE obj, VALUE objid)
return ID2SYM(symid);
}
if (!is_pointer_to_heap((void *)ptr)|| BUILTIN_TYPE(ptr) >= T_BLOCK) {
if (!is_pointer_to_heap((void *)ptr) || BUILTIN_TYPE(ptr) >= T_VALUES) {
rb_raise(rb_eRangeError, "%p is not id value", p0);
}
if (BUILTIN_TYPE(ptr) == 0 || RBASIC(ptr)->klass == 0) {