[前][次][番号順一覧][スレッド一覧]

ruby-changes:29265

From: nagachika <ko1@a...>
Date: Sun, 16 Jun 2013 00:38:03 +0900 (JST)
Subject: [ruby-changes:29265] nagachika:r41317 (ruby_2_0_0): merge revision(s) 40759,40966,41305,41306: [Backport #8436]

nagachika	2013-06-16 00:36:51 +0900 (Sun, 16 Jun 2013)

  New Revision: 41317

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41317

  Log:
    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]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/test/ruby/test_method.rb
    branches/ruby_2_0_0/version.h
    branches/ruby_2_0_0/vm_eval.c

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 41316)
+++ ruby_2_0_0/ChangeLog	(revision 41317)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Jun 16 00:30:56 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
Index: ruby_2_0_0/vm_eval.c
===================================================================
--- ruby_2_0_0/vm_eval.c	(revision 41316)
+++ ruby_2_0_0/vm_eval.c	(revision 41317)
@@ -1157,7 +1157,7 @@ eval_string_with_cref(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_eval.c#L1157
     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 https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_eval.c#L1173
     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 https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_eval.c#L1184
 		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 https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_eval.c#L1212
 	/* 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--;
 
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 41316)
+++ ruby_2_0_0/version.h	(revision 41317)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #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"
 
Index: ruby_2_0_0/test/ruby/test_method.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_method.rb	(revision 41316)
+++ ruby_2_0_0/test/ruby/test_method.rb	(revision 41317)
@@ -505,7 +505,9 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_method.rb#L505
 
   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

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r40759,40966,41305-41306


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]