From cabeaac37bd55efc9adb59dcb713295bab1e3392 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 27 Oct 1999 04:20:00 +0000 Subject: [PATCH] register class/module git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- marshal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/marshal.c b/marshal.c index 657be5a1b4..4f13724a27 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: