From 73a47246f27d7967ec8af5fb7ce43064d4a64d40 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 17 Sep 2002 09:36:05 +0000 Subject: * eval.c (rb_mod_nesting): load wrapping module should appear in Module#nesting list. (ruby-bugs-ja:PR#328) * eval.c (rb_thread_remove): free stack buffer on remove. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ eval.c | 5 +++++ marshal.c | 14 +++++++------- variable.c | 1 + 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21b35cfb74..5d596c4ffb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Sep 17 01:13:31 2002 Yukihiro Matsumoto + + * eval.c (rb_mod_nesting): load wrapping module should appear in + Module#nesting list. (ruby-bugs-ja:PR#328) + + * eval.c (rb_thread_remove): free stack buffer on remove. + Tue Sep 17 00:58:35 2002 Minero Aoki * io.c: add parameter prototype. diff --git a/eval.c b/eval.c index 8d93cbcfd5..14915d6d22 100644 --- a/eval.c +++ b/eval.c @@ -1570,6 +1570,9 @@ rb_mod_nesting() if (!NIL_P(cbase->nd_clss)) rb_ary_push(ary, cbase->nd_clss); cbase = cbase->nd_next; } + if (ruby_wrapper && RARRAY(ary)->len == 0) { + rb_ary_push(ary, ruby_wrapper); + } return ary; } @@ -7766,6 +7769,8 @@ rb_thread_remove(th) th->gid = 0; th->prev->next = th->next; th->next->prev = th->prev; + if (th->stk_ptr) free(th->stk_ptr); + th->stk_ptr = 0; } static int diff --git a/marshal.c b/marshal.c index e52508db25..0e54f42cc8 100644 --- a/marshal.c +++ b/marshal.c @@ -43,7 +43,7 @@ shortlen(len, ds) #endif #define MARSHAL_MAJOR 4 -#define MARSHAL_MINOR 7 +#define MARSHAL_MINOR 8 #define TYPE_NIL '0' #define TYPE_TRUE 'T' @@ -371,24 +371,24 @@ w_object(obj, arg, limit) if (OBJ_TAINTED(obj)) arg->taint = Qtrue; + if (ivtbl = rb_generic_ivar_table(obj)) { + w_byte(TYPE_IVAR, arg); + } + st_add_direct(arg->data, obj, arg->data->num_entries); if (rb_respond_to(obj, s_dump)) { VALUE v; - w_byte(TYPE_USERDEF, arg); - w_unique(rb_class2name(CLASS_OF(obj)), arg); + w_class(TYPE_USERDEF, obj, arg); v = rb_funcall(obj, s_dump, 1, INT2NUM(limit)); if (TYPE(v) != T_STRING) { rb_raise(rb_eTypeError, "_dump() must return String"); } w_bytes(RSTRING(v)->ptr, RSTRING(v)->len, arg); + if (ivtbl) w_ivar(ivtbl, &c_arg); return; } - if (ivtbl = rb_generic_ivar_table(obj)) { - w_byte(TYPE_IVAR, arg); - } - switch (BUILTIN_TYPE(obj)) { case T_CLASS: if (FL_TEST(obj, FL_SINGLETON)) { diff --git a/variable.c b/variable.c index 18cd0c14ee..255854d8f0 100644 --- a/variable.c +++ b/variable.c @@ -1458,6 +1458,7 @@ original_module(c) static void cvar_override_check(id, a) + ID id; VALUE a; { VALUE base = original_module(a); -- cgit v1.2.3