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

ruby-changes:22258

From: naruse <ko1@a...>
Date: Sun, 15 Jan 2012 15:52:51 +0900 (JST)
Subject: [ruby-changes:22258] naruse:r34306 (trunk): * ext/json/parser/parser.rl (json_string_unescape): workaround fix

naruse	2012-01-15 15:52:36 +0900 (Sun, 15 Jan 2012)

  New Revision: 34306

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

  Log:
    * ext/json/parser/parser.rl (json_string_unescape): workaround fix
      for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862

  Modified files:
    trunk/ChangeLog
    trunk/ext/json/parser/parser.c
    trunk/ext/json/parser/parser.rl

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34305)
+++ ChangeLog	(revision 34306)
@@ -1,3 +1,9 @@
+Sun Jan 15 13:21:50 2012  NARUSE, Yui  <naruse@r...>
+
+	* ext/json/parser/parser.rl (json_string_unescape): workaround fix
+	  for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
+	  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862
+
 Sat Jan 14 22:24:09 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/dl/callback/mkcallback.rb (gencallback): suppress unused
Index: ext/json/parser/parser.rl
===================================================================
--- ext/json/parser/parser.rl	(revision 34305)
+++ ext/json/parser/parser.rl	(revision 34306)
@@ -393,6 +393,7 @@
 {
     char *p = string, *pe = string, *unescape;
     int unescape_len;
+    char buf[4];
 
     while (pe < stringEnd) {
         if (*pe == '\\') {
@@ -425,7 +426,6 @@
                     if (pe > stringEnd - 4) {
                         return Qnil;
                     } else {
-                        char buf[4];
                         UTF32 ch = unescape_unicode((unsigned char *) ++pe);
                         pe += 3;
                         if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
Index: ext/json/parser/parser.c
===================================================================
--- ext/json/parser/parser.c	(revision 34305)
+++ ext/json/parser/parser.c	(revision 34306)
@@ -1293,6 +1293,7 @@
 {
     char *p = string, *pe = string, *unescape;
     int unescape_len;
+    char buf[4];
 
     while (pe < stringEnd) {
         if (*pe == '\\') {
@@ -1325,7 +1326,6 @@
                     if (pe > stringEnd - 4) {
                         return Qnil;
                     } else {
-                        char buf[4];
                         UTF32 ch = unescape_unicode((unsigned char *) ++pe);
                         pe += 3;
                         if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {

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

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