From d0be5c2d4c317c3cd71cf438a704a3f79721367c Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 30 Mar 2014 15:43:51 +0000 Subject: merge revision(s) r45360,r45361: [Backport #9651] * vm_eval.c (eval_string_with_cref): Use file path even if scope is given. Related to [ruby-core:56099] [Bug #8662] and r42103. * vm_eval.c (eval_string_with_cref): Unify to use NIL_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@45474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 6095e1d84c..b5842137ea 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1194,14 +1194,15 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, volatile V VALUE absolute_path = Qnil; VALUE fname; + if (file != Qundef) { + absolute_path = file; + } + if (scope != Qnil) { if (rb_obj_is_kind_of(scope, rb_cBinding)) { GetBindingPtr(scope, bind); envval = bind->env; - if (file != Qundef) { - absolute_path = file; - } - else if (!NIL_P(bind->path)) { + if (NIL_P(absolute_path) && !NIL_P(bind->path)) { file = bind->path; line = bind->first_lineno; absolute_path = rb_current_realfilepath(); -- cgit v1.2.3