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

ruby-changes:27040

From: usa <ko1@a...>
Date: Wed, 6 Feb 2013 14:15:06 +0900 (JST)
Subject: [ruby-changes:27040] usa:r39092 (ruby_1_9_3): merge revision(s) 37174: [Backport #7754]

usa	2013-02-06 14:14:53 +0900 (Wed, 06 Feb 2013)

  New Revision: 39092

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

  Log:
    merge revision(s) 37174: [Backport #7754]
    
    * file.c (realpath_rec): prevent link from GC while link_names refers
      the content.

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/file.c
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 39091)
+++ ruby_1_9_3/ChangeLog	(revision 39092)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Wed Feb  6 14:14:38 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* file.c (realpath_rec): prevent link from GC while link_names refers
+	  the content.
+
 Wed Feb  6 14:13:25 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 39091)
+++ ruby_1_9_3/version.h	(revision 39092)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 377
+#define RUBY_PATCHLEVEL 378
 
 #define RUBY_RELEASE_DATE "2013-02-06"
 #define RUBY_RELEASE_YEAR 2013
Index: ruby_1_9_3/file.c
===================================================================
--- ruby_1_9_3/file.c	(revision 39091)
+++ ruby_1_9_3/file.c	(revision 39092)
@@ -3378,6 +3378,7 @@ realpath_rec(long *prefixlenp, VALUE *re https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/file.c#L3378
 #ifdef HAVE_READLINK
                 if (S_ISLNK(sbuf.st_mode)) {
 		    VALUE link;
+		    volatile VALUE link_orig = Qnil;
 		    const char *link_prefix, *link_names;
                     long link_prefixlen;
                     rb_hash_aset(loopcheck, testpath, ID2SYM(resolving));
@@ -3387,6 +3388,7 @@ realpath_rec(long *prefixlenp, VALUE *re https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/file.c#L3388
 		    link_prefixlen = link_names - link_prefix;
 		    if (link_prefixlen > 0) {
 			rb_encoding *enc, *linkenc = rb_enc_get(link);
+			link_orig = link;
 			link = rb_str_subseq(link, 0, link_prefixlen);
 			enc = rb_enc_check(*resolvedp, link);
 			if (enc != linkenc) link = rb_str_conv_enc(link, linkenc, enc);
@@ -3394,6 +3396,7 @@ realpath_rec(long *prefixlenp, VALUE *re https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/file.c#L3396
 			*prefixlenp = link_prefixlen;
 		    }
 		    realpath_rec(prefixlenp, resolvedp, link_names, loopcheck, strict, *unresolved_firstsep == '\0');
+		    RB_GC_GUARD(link_orig);
 		    rb_hash_aset(loopcheck, testpath, rb_str_dup_frozen(*resolvedp));
                 }
                 else

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r37174


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

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