summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-07 01:03:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-07 01:03:08 +0000
commit2b82367a470f9d40eb2d83b3e73416ade084e8f7 (patch)
treeff56571a7415ce2f29b80988d3b27cacde4a59dd /eval.c
parent3a86596df156d85ed58cd8e51b94d045021b731e (diff)
* eval.c (rb_yield_0): should enable trace for non-cfunc nodes.
[ruby-dev:18645] * eval.c (blk_orphan): a block created in a different thread is orphan. [ruby-dev:17471] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index ff8e6f2ad4..6a7254587e 100644
--- a/eval.c
+++ b/eval.c
@@ -3794,6 +3794,7 @@ rb_yield_0(val, self, klass, pcall)
int pcall;
{
NODE *node;
+ volatile int old_tracing = tracing;
volatile VALUE result = Qnil;
volatile VALUE old_cref;
volatile VALUE old_wrapper;
@@ -3876,6 +3877,7 @@ rb_yield_0(val, self, klass, pcall)
result = (*node->nd_cfnc)(val, node->nd_tval, self);
}
else {
+ ENABLE_TRACE();
result = rb_eval(self, node);
}
}
@@ -3901,6 +3903,7 @@ rb_yield_0(val, self, klass, pcall)
}
POP_TAG();
POP_ITER();
+ tracing = old_tracing;
pop_state:
POP_CLASS();
if (ruby_dyna_vars && (block->flags & BLOCK_D_SCOPE) &&
@@ -6544,10 +6547,8 @@ static int
blk_orphan(data)
struct BLOCK *data;
{
- if (!(data->scope->flags & SCOPE_NOSTACK)) {
- return 0;
- }
- if ((data->tag->flags & BLOCK_ORPHAN)) {
+ if ((data->tag->flags & BLOCK_ORPHAN) &&
+ (data->scope->flags & SCOPE_NOSTACK)) {
return 1;
}
if (data->orig_thread != rb_thread_current()) {