summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-27 04:20:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-27 04:20:00 +0000
commitcabeaac37bd55efc9adb59dcb713295bab1e3392 (patch)
tree5ab290fce1412c465e587b3d2c2a2e01d28d5375
parentad39669418c15f7a1ce6c8bae9c78a3ce1c795f7 (diff)
register class/module
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--marshal.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/marshal.c b/marshal.c
index 657be5a1b4b..4f13724a274 100644
--- a/marshal.c
+++ b/marshal.c
@@ -617,10 +617,11 @@ r_object(arg)
switch (type) {
case TYPE_LINK:
id = r_long(arg);
- if (v = rb_hash_aref(arg->data, INT2FIX(id))) {
- return v;
+ v = rb_hash_aref(arg->data, INT2FIX(id));
+ if (NIL_P(v)) {
+ rb_raise(rb_eArgError, "dump format error (unlinked)");
}
- rb_raise(rb_eArgError, "dump format error (unlinked)");
+ return v;
break;
case TYPE_UCLASS:
@@ -791,7 +792,7 @@ r_object(arg)
{
char *buf;
r_bytes(buf, arg);
- return rb_path2class(buf);
+ return r_regist(rb_path2class(buf), arg);
}
default: