summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-22 12:52:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-22 12:52:18 +0000
commit742283385fc8539e76581ad2482ad62ed8a12c76 (patch)
treee139ff6c1bb02c3cfda4d5fa224f6b88c5b898f3 /eval.c
parentf3cdd50125b9a66b18766dc1eaaff10fbc92a29d (diff)
* eval.c (call_trace_func): should not call trace function while
compilation. * eval.c (rb_call0): also inside c-func. * parse.y (yycompile): ditto. * ruby.c (require_libraries): preserve source file/line for each require. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 1bbf65f..1a9b77c 100644
--- a/eval.c
+++ b/eval.c
@@ -895,8 +895,7 @@ void
ruby_set_current_source()
{
if (ruby_current_node) {
- ruby_sourcefile = ruby_current_node->nd_file;
- ruby_sourceline = nd_line(ruby_current_node);
+ SET_CURRENT_SOURCE();
}
}
@@ -2061,6 +2060,7 @@ call_trace_func(event, node, self, id, klass)
if (!trace_func) return;
if (tracing) return;
+ if (ruby_in_compile) return;
node_save[0] = ruby_last_node;
if (!(node_save[1] = ruby_current_node)) {
@@ -4501,17 +4501,21 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
}
if (trace_func) {
int state;
+ NODE *volatile node = ruby_current_node;
call_trace_func("c-call", ruby_current_node, recv, id, klass);
+ ruby_current_node = 0;
PUSH_TAG(PROT_FUNC);
if ((state = EXEC_TAG()) == 0) {
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
}
POP_TAG();
+ ruby_current_node = node;
call_trace_func("c-return", ruby_current_node, recv, id, klass);
if (state) JUMP_TAG(state);
}
else {
+ ruby_current_node = 0;
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
}
}