summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-24 06:32:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-24 06:32:40 +0000
commit941e43aacf9299ffdeb3761a1625d76a4fcdc947 (patch)
tree8f1daa6a0398c741cf9ba4bdc670b8d2a855bd98 /eval.c
parent9c4a4822296e43b3722f203418a005b7651a1e94 (diff)
* eval.c (call_trace_func): restore source file/line, as trace
function installed in required library with -r option can be called while parsing. (ruby-bugs:PR#372) * eval.c (module_setup): unused variable. [ruby-core:00358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 54b6ee0..fdde01f 100644
--- a/eval.c
+++ b/eval.c
@@ -2079,12 +2079,16 @@ call_trace_func(event, node, self, id, klass)
{
int state;
struct FRAME *prev;
- NODE *node_save = ruby_last_node;
+ NODE *node_save[2];
VALUE srcfile;
if (!trace_func) return;
if (tracing) return;
+ node_save[0] = ruby_last_node;
+ if (!(node_save[1] = ruby_current_node)) {
+ node_save[1] = NEW_NEWLINE(0);
+ }
tracing = 1;
prev = ruby_frame;
PUSH_FRAME();
@@ -2120,7 +2124,9 @@ call_trace_func(event, node, self, id, klass)
POP_FRAME();
tracing = 0;
- ruby_last_node = node_save;
+ ruby_last_node = node_save[0];
+ ruby_current_node = node_save[1];
+ SET_CURRENT_SOURCE();
if (state) JUMP_TAG(state);
}
@@ -3424,7 +3430,6 @@ module_setup(module, n)
int state;
struct FRAME frame;
VALUE result; /* OK */
- NODE * cnode = ruby_current_node; /* NOT IN USE, is it OK? */
TMP_PROTECT;
frame = *ruby_frame;