aboutsummaryrefslogtreecommitdiffstats
path: root/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/marshal.c b/marshal.c
index 88ea2916c2..480ae599a2 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1739,8 +1739,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
}
v = r_object0(arg, 0, extmod);
if (rb_special_const_p(v) || RB_TYPE_P(v, T_OBJECT) || RB_TYPE_P(v, T_CLASS)) {
- format_error:
- rb_raise(rb_eArgError, "dump format error (user class)");
+ goto format_error;
}
if (RB_TYPE_P(v, T_MODULE) || !RTEST(rb_class_inherited_p(c, RBASIC(v)->klass))) {
VALUE tmp = rb_obj_alloc(c);
@@ -1751,6 +1750,9 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
}
break;
+ format_error:
+ rb_raise(rb_eArgError, "dump format error (user class)");
+
case TYPE_NIL:
v = Qnil;
v = r_leave(v, arg);