diff options
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1515,6 +1515,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) { VALUE path = r_unique(arg); VALUE m = rb_path_to_class(path); + if (NIL_P(extmod)) extmod = rb_ary_tmp_new(0); if (RB_TYPE_P(m, T_CLASS)) { /* prepended */ VALUE c; @@ -1534,7 +1535,6 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) } else { must_be_module(m, path); - if (NIL_P(extmod)) extmod = rb_ary_tmp_new(0); rb_ary_push(extmod, m); v = r_object0(arg, 0, extmod); @@ -1894,6 +1894,11 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) rb_raise(rb_eArgError, "dump format error(0x%x)", type); break; } + + if (v == Qundef) { + rb_raise(rb_eArgError, "dump format error (bad link)"); + } + return v; } |