summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-15 15:36:51 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-15 15:36:51 +0000
commite63d45a5f910f0a1dc2de3aeb07b85bfe84b9051 (patch)
tree2da72f694c5a9a26f0b53e72d6413d9c420cce9e /vm_eval.c
parent3190cb8fbf3bb8801dc6a5c7e0a613a8730ddd06 (diff)
merge revision(s) 40759,40966,41305,41306: [Backport #8436]
vm_eval.c: suppress warning * vm_eval.c (eval_string_with_cref): narrow a variable scope into the EXEC_TAG block to suppress -Wclobberd warning. * vm_eval.c (eval_string_with_cref): propagate absolute path from the binding if it is given explicitly. patch by Gat (Dawid Janczak) at [ruby-core:55123]. [Bug #8436] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vm_eval.c b/vm_eval.c
index a52ab21e81..a152a6990e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1157,7 +1157,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
int state;
VALUE result = Qundef;
VALUE envval;
- rb_binding_t *bind = 0;
+ VALUE absolute_path = Qnil;
rb_thread_t *th = GET_THREAD();
rb_env_t *env = NULL;
rb_block_t block, *base_block;
@@ -1173,6 +1173,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
mild_compile_error = th->mild_compile_error;
TH_PUSH_TAG(th);
if ((state = TH_EXEC_TAG()) == 0) {
+ rb_binding_t *bind = 0;
rb_iseq_t *iseq;
volatile VALUE iseqval;
@@ -1183,6 +1184,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
if (strcmp(file, "(eval)") == 0 && bind->path != Qnil) {
file = RSTRING_PTR(bind->path);
line = bind->first_lineno;
+ absolute_path = rb_current_realfilepath();
}
}
else {
@@ -1210,7 +1212,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
/* make eval iseq */
th->parse_in_eval++;
th->mild_compile_error++;
- iseqval = rb_iseq_compile_on_base(src, rb_str_new2(file), INT2FIX(line), base_block);
+ iseqval = rb_iseq_compile_with_option(src, rb_str_new2(file), absolute_path, INT2FIX(line), base_block, Qnil);
th->mild_compile_error--;
th->parse_in_eval--;