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

ruby-changes:42174

From: nobu <ko1@a...>
Date: Thu, 24 Mar 2016 22:38:26 +0900 (JST)
Subject: [ruby-changes:42174] nobu:r54248 (trunk): strftime.c: remove recursive-assignments

nobu	2016-03-24 22:38:20 +0900 (Thu, 24 Mar 2016)

  New Revision: 54248

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54248

  Log:
    strftime.c: remove recursive-assignments
    
    * strftime.c (FMT, FMTV): remove recursive-assignments to get rid
      of undefined behavior.  [ruby-core:74532] [Bug #12213]

  Modified files:
    trunk/ChangeLog
    trunk/strftime.c
Index: strftime.c
===================================================================
--- strftime.c	(revision 54247)
+++ strftime.c	(revision 54248)
@@ -287,7 +287,7 @@ rb_strftime_with_timespec(VALUE ftime, c https://github.com/ruby/ruby/blob/trunk/strftime.c#L287
 		 (precision <= 0) ? (precision = (def_prec)) : (precision))
 #define FMT(def_pad, def_prec, fmt, val) \
 		do { \
-			precision = FMT_PRECISION(def_prec); \
+			FMT_PRECISION(def_prec); \
 			len = s - start; \
 			NEEDS(precision); \
 			rb_str_set_len(ftime, len); \
@@ -324,7 +324,7 @@ rb_strftime_with_timespec(VALUE ftime, c https://github.com/ruby/ruby/blob/trunk/strftime.c#L324
                         } \
                         else { \
 				const char *fmts = FMT_PADDING(fmt, def_pad); \
-				precision = FMT_PRECISION(def_prec); \
+				FMT_PRECISION(def_prec); \
 				tmp = format_value(fmts, tmp, precision); \
 				rb_str_append(ftime, tmp); \
 				RSTRING_GETMEM(ftime, s, len); \
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54247)
+++ ChangeLog	(revision 54248)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 24 22:38:18 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* strftime.c (FMT, FMTV): remove recursive-assignments to get rid
+	  of undefined behavior.  [ruby-core:74532] [Bug #12213]
+
+Thu Mar 24 22:38:05 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* strftime.c (FMT, FMTV): remove recursive-assignments to get rid
+	  of undefined behavior.  [ruby-core:74532] [Bug #12213]
+
 Thu Mar 24 17:44:02 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* strftime.c (FMT_PADDING): extract format for padding.

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

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