diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-15 15:36:51 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-15 15:36:51 +0000 |
commit | e63d45a5f910f0a1dc2de3aeb07b85bfe84b9051 (patch) | |
tree | 2da72f694c5a9a26f0b53e72d6413d9c420cce9e | |
parent | 3190cb8fbf3bb8801dc6a5c7e0a613a8730ddd06 (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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/ruby/test_method.rb | 4 | ||||
-rw-r--r-- | version.h | 6 | ||||
-rw-r--r-- | vm_eval.c | 6 |
4 files changed, 16 insertions, 6 deletions
@@ -1,3 +1,9 @@ +Sun Jun 16 00:30:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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] + Wed Jun 12 23:41:21 2013 NARUSE, Yui <naruse@ruby-lang.org> * vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019. diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 1546e15107..688386774c 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -505,7 +505,9 @@ class TestMethod < Test::Unit::TestCase def test___dir__ assert_instance_of String, __dir__ - assert_equal(File.dirname(__FILE__), __dir__) + assert_equal(File.dirname(File.realpath(__FILE__)), __dir__) + bug8436 = '[ruby-core:55123] [Bug #8436]' + assert_equal(__dir__, eval("__dir__", binding), bug8436) end def test_alias_owner @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-06-13" -#define RUBY_PATCHLEVEL 216 +#define RUBY_RELEASE_DATE "2013-06-16" +#define RUBY_PATCHLEVEL 217 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 13 +#define RUBY_RELEASE_DAY 16 #include "ruby/version.h" @@ -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--; |