diff --git a/ChangeLog b/ChangeLog index 73aa4f2d31..7f9f5656bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 26 15:41:30 2002 Yukihiro Matsumoto + + * eval.c (rb_eval): call trace_func for if/while conditions. + + * marshal.c (r_object): separate r_regist from proc calling. + Tue Feb 26 11:25:50 2002 akira yamada * lib/uri/generic.rb: merge0 shuld return [oth, oth] if oth is diff --git a/eval.c b/eval.c index e6bcdc859e..26962c2e17 100644 --- a/eval.c +++ b/eval.c @@ -2231,6 +2231,11 @@ rb_eval(self, n) case NODE_IF: ruby_sourceline = nd_line(node); + if (trace_func) { + call_trace_func("line", node->nd_file, ruby_sourceline, self, + ruby_frame->last_func, + ruby_frame->last_class); + } if (RTEST(rb_eval(self, node->nd_cond))) { node = node->nd_body; } @@ -2361,6 +2366,7 @@ rb_eval(self, n) result = Qnil; switch (state = EXEC_TAG()) { case 0: + ruby_sourceline = nd_line(node); if (node->nd_state && RTEST(rb_eval(self, node->nd_cond))) goto until_out; do { diff --git a/marshal.c b/marshal.c index 5966a7659d..8b71e905f9 100644 --- a/marshal.c +++ b/marshal.c @@ -764,9 +764,6 @@ r_regist(v, arg) VALUE v; struct load_arg *arg; { - if (arg->proc) { - rb_funcall(arg->proc, rb_intern("call"), 1, v); - } rb_hash_aset(arg->data, INT2FIX(RHASH(arg->data)->tbl->num_entries), v); if (arg->taint) OBJ_TAINT(v); return v; @@ -793,7 +790,7 @@ static VALUE r_object(arg) struct load_arg *arg; { - VALUE v; + VALUE v = Qnil; int type = r_byte(arg); long id; @@ -805,7 +802,6 @@ r_object(arg) rb_raise(rb_eArgError, "dump format error (unlinked)"); } return v; - break; case TYPE_IVAR: v = r_object(arg); @@ -831,19 +827,22 @@ r_object(arg) } case TYPE_NIL: - return Qnil; + v = Qnil; + break; case TYPE_TRUE: - return Qtrue; + v = Qtrue; + break; case TYPE_FALSE: - return Qfalse; + v = Qfalse; case TYPE_FIXNUM: { long i = r_long(arg); - return INT2FIX(i); + v = INT2FIX(i); } + break; case TYPE_FLOAT: { @@ -865,8 +864,9 @@ r_object(arg) d = strtod(buf, 0); } v = rb_float_new(d); - return r_regist(v, arg); + r_regist(v, arg); } + break; case TYPE_BIGNUM: { @@ -905,11 +905,13 @@ r_object(arg) if (TYPE(big) == T_BIGNUM) { r_regist((VALUE)big, arg); } - return (VALUE)big; + v = (VALUE)big; } + break; case TYPE_STRING: - return r_regist(r_string(arg), arg); + v = r_regist(r_string(arg), arg); + break; case TYPE_REGEXP: { @@ -919,19 +921,21 @@ r_object(arg) r_bytes2(buf, len, arg); options = r_byte(arg); - return r_regist(rb_reg_new(buf, len, options), arg); + v = r_regist(rb_reg_new(buf, len, options), arg); } + break; case TYPE_ARRAY: { volatile long len = r_long(arg); /* gcc 2.7.2.3 -O2 bug?? */ v = rb_ary_new2(len); + r_regist(v, arg); while (len--) { rb_ary_push(v, r_object(arg)); } - return r_regist(v, arg);; } + break; case TYPE_HASH: case TYPE_HASH_DEF: @@ -939,6 +943,7 @@ r_object(arg) long len = r_long(arg); v = rb_hash_new(); + r_regist(v, arg); while (len--) { VALUE key = r_object(arg); VALUE value = r_object(arg); @@ -947,8 +952,8 @@ r_object(arg) if (type == TYPE_HASH_DEF) { RHASH(v)->ifnone = r_object(arg); } - return r_regist(v, arg); } + break; case TYPE_STRUCT: { @@ -969,6 +974,7 @@ r_object(arg) rb_ary_push(values, Qnil); } v = rb_struct_alloc(klass, values); + r_regist(v, arg); for (i=0; iproc) { + rb_funcall(arg->proc, rb_intern("yield"), 1, v); + } + return v; } static VALUE diff --git a/process.c b/process.c index 7f1375dd32..e35308c0b5 100644 --- a/process.c +++ b/process.c @@ -797,6 +797,7 @@ rb_syswait(pid) signal(SIGQUIT, qfunc); #endif signal(SIGINT, ifunc); + overriding = Qfalse; } }