summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-08 03:48:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-08 03:48:33 +0000
commitc49c51b76ec544e310f1881de087024f4def7585 (patch)
treebbe0cb14b245a23f3ab03f2e52a4589454187b46 /marshal.c
parent25358510afd53a718e3b2b810be7ee1e7cf56ea4 (diff)
* marshal.c (w_object): should set `c_arg' at first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/marshal.c b/marshal.c
index 03992f6..84125f7 100644
--- a/marshal.c
+++ b/marshal.c
@@ -434,6 +434,10 @@ w_object(obj, arg, limit)
rb_raise(rb_eArgError, "exceed depth limit");
}
+ limit--;
+ c_arg.limit = limit;
+ c_arg.arg = arg;
+
if (ivtbl = rb_generic_ivar_table(obj)) {
w_byte(TYPE_IVAR, arg);
}
@@ -466,10 +470,6 @@ w_object(obj, arg, limit)
else {
long num;
- limit--;
- c_arg.limit = limit;
- c_arg.arg = arg;
-
if (st_lookup(arg->data, obj, &num)) {
w_byte(TYPE_LINK, arg);
w_long(num, arg);