summaryrefslogtreecommitdiff
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
commit1ea78bb8ff454b386583856eabb3a29da48d99e5 (patch)
tree1d0e8b11cac13222f75455b7c0ff53545814a183 /eval.c
parenta21b0c47c34613f72942f23e9bb2b9eaa0755d08 (diff)
* eval.c (rb_load): should preserve current source file/line.
git-svn-id: svn+ssh://ci.ruby-lang.org/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 35fed14138..acfb22068f 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);