summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
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 03992f6bdd..84125f767e 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);