summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-23 07:24:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-23 07:24:26 +0000
commit4dda2d064a5f8ea8be32a0da61331eb355c2ee91 (patch)
tree896356b01848676a59353ea4e2048273a31d8ec0 /eval.c
parent3b28dd73fbed399fad3760faeb6a79f8d33ad28e (diff)
downloadruby-4dda2d064a5f8ea8be32a0da61331eb355c2ee91.tar.gz
ruby-4dda2d064a5f8ea8be32a0da61331eb355c2ee91.tar.xz
ruby-4dda2d064a5f8ea8be32a0da61331eb355c2ee91.zip
* eval.c (rb_yield_0): restore source file/line after yield.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index c7c5708c6..be5858c2d 100644
--- a/eval.c
+++ b/eval.c
@@ -3670,6 +3670,8 @@ rb_yield_0(val, self, klass, pcall)
struct BLOCK * volatile block;
struct SCOPE * volatile old_scope;
struct FRAME frame;
+ char *const file = ruby_sourcefile;
+ int line = ruby_sourceline;
int state;
static unsigned serial = 1;
@@ -3794,6 +3796,8 @@ rb_yield_0(val, self, klass, pcall)
if (ruby_scope->flags & SCOPE_DONT_RECYCLE)
scope_dup(old_scope);
ruby_scope = old_scope;
+ ruby_sourcefile = file;
+ ruby_sourceline = line;
if (state) {
if (!block->tag) {
switch (state & TAG_MASK) {