summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-05 06:47:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-05 06:47:37 +0000
commit9abdbf4e17a6623ba9fa25a54e726f56cd61f81e (patch)
tree1d0e8b11cac13222f75455b7c0ff53545814a183 /eval.c
parent0f78830a1b35d2003dd27cbe59ec7ad969d1e8ea (diff)
downloadruby-9abdbf4e17a6623ba9fa25a54e726f56cd61f81e.tar.gz
ruby-9abdbf4e17a6623ba9fa25a54e726f56cd61f81e.tar.xz
ruby-9abdbf4e17a6623ba9fa25a54e726f56cd61f81e.zip
* eval.c (rb_load): should preserve current source file/line.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 35fed1413..acfb22068 100644
--- a/eval.c
+++ b/eval.c
@@ -5715,6 +5715,7 @@ rb_load(fname, wrap)
volatile ID last_func;
volatile VALUE wrapper = 0;
volatile VALUE self = ruby_top_self;
+ NODE *volatile last_node;
NODE *saved_cref = ruby_cref;
TMP_PROTECT;
@@ -5759,6 +5760,11 @@ rb_load(fname, wrap)
PUSH_TAG(PROT_NONE);
state = EXEC_TAG();
last_func = ruby_frame->last_func;
+ last_node = ruby_current_node;
+ if (!ruby_current_node && ruby_sourcefile) {
+ last_node = NEW_NEWLINE(0);
+ }
+ ruby_current_node = 0;
if (state == 0) {
NODE *node;
volatile int critical;
@@ -5777,6 +5783,9 @@ rb_load(fname, wrap)
}
ALLOW_INTS;
ruby_frame->last_func = last_func;
+ ruby_current_node = last_node;
+ ruby_sourcefile = 0;
+ ruby_set_current_source();
if (ruby_scope->flags == SCOPE_ALLOCA && ruby_class == rb_cObject) {
if (ruby_scope->local_tbl) /* toplevel was empty */
free(ruby_scope->local_tbl);