diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-17 02:27:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-17 02:27:38 +0000 |
commit | 288ceaeec2077d06df3ba46bca97960f76f283e1 (patch) | |
tree | 8593a93244c96b098dd6611ee7e4dfe2c7ba9957 /eval.c | |
parent | 3ad741f132133bb542a84a01d8e7644fc4b51e4c (diff) |
* re.c (rb_reg_initialize_m): should raise exception instead of
compile error. [ruby-core:03755]
* string.c (rb_str_splice): move rb_str_modify() after
StringValue(), which may alter the receiver. [ruby-dev:24878]
* error.c (rb_error_frozen): now raise RuntimeError instead of
TypeError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -2651,7 +2651,7 @@ rb_eval(self, n) if (!node) RETURN(Qnil); ruby_current_node = node; - if (trace_func && FL_TEST(node, NODE_NEWLINE)) { + if (trace_func && (node->flags & NODE_NEWLINE)) { call_trace_func("line", node, self, ruby_frame->last_func, ruby_frame->last_class); @@ -4513,6 +4513,7 @@ proc_jump_error(state, result) localjump_error(mesg, result, state); } +NORETURN(static void return_jump(VALUE)); static void return_jump(retval) VALUE retval; @@ -4526,14 +4527,15 @@ return_jump(retval) yield = Qtrue; tt = tt->prev; } - if (tt->tag == PROT_FUNC && tt->frame->uniq == ruby_frame->uniq) { - tt->dst = (VALUE)ruby_frame->uniq; - tt->retval = retval; - JUMP_TAG(TAG_RETURN); - } - if (tt->tag == PROT_LAMBDA && !yield) { + if ((tt->tag == PROT_FUNC && tt->frame->uniq == ruby_frame->uniq) || + (tt->tag == PROT_LAMBDA && !yield)) + { tt->dst = (VALUE)tt->frame->uniq; tt->retval = retval; + if (trace_func) { + struct FRAME *f = tt->frame; + call_trace_func("return", f->node, f->self, f->last_func, f->last_class); + } JUMP_TAG(TAG_RETURN); } if (tt->tag == PROT_THREAD) { @@ -5650,6 +5652,9 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper) call_trace_func("call", b2, recv, id, klass); } result = rb_eval(recv, body); + if (trace_func) { + call_trace_func("return", body, recv, id, klass); + } } else if (state == TAG_RETURN && TAG_DST()) { result = prot_tag->retval; @@ -5660,9 +5665,6 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper) POP_CLASS(); POP_SCOPE(); ruby_cref = saved_cref; - if (trace_func) { - call_trace_func("return", ruby_frame->prev->node, recv, id, klass); - } switch (state) { case 0: break; |