mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
register class/module
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ad39669418
commit
cabeaac37b
1 changed files with 5 additions and 4 deletions
|
@ -617,10 +617,11 @@ r_object(arg)
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TYPE_LINK:
|
case TYPE_LINK:
|
||||||
id = r_long(arg);
|
id = r_long(arg);
|
||||||
if (v = rb_hash_aref(arg->data, INT2FIX(id))) {
|
v = rb_hash_aref(arg->data, INT2FIX(id));
|
||||||
return v;
|
if (NIL_P(v)) {
|
||||||
|
rb_raise(rb_eArgError, "dump format error (unlinked)");
|
||||||
}
|
}
|
||||||
rb_raise(rb_eArgError, "dump format error (unlinked)");
|
return v;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_UCLASS:
|
case TYPE_UCLASS:
|
||||||
|
@ -791,7 +792,7 @@ r_object(arg)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
r_bytes(buf, arg);
|
r_bytes(buf, arg);
|
||||||
return rb_path2class(buf);
|
return r_regist(rb_path2class(buf), arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue