From e80d0a9631cdfebc53c1a111eb2162fe3f1dc67c Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 15 Apr 2013 05:58:19 +0000 Subject: [PATCH] merge revision(s) 34306: * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@40305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ext/json/parser/parser.c | 2 +- ext/json/parser/parser.rl | 2 +- version.h | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bb6039f3c..004c362ea8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Apr 15 14:57:43 2013 NARUSE, Yui + + * 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 + Mon Apr 15 10:56:55 2013 NARUSE, Yui * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index 42f9bf2285..bd8199a10c 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -1283,6 +1283,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd) { char *p = string, *pe = string, *unescape; int unescape_len; + char buf[4]; while (pe < stringEnd) { if (*pe == '\\') { @@ -1315,7 +1316,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd) 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)) { diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl index 9fafaedb7e..2f4e9390cd 100644 --- a/ext/json/parser/parser.rl +++ b/ext/json/parser/parser.rl @@ -382,6 +382,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd) { char *p = string, *pe = string, *unescape; int unescape_len; + char buf[4]; while (pe < stringEnd) { if (*pe == '\\') { @@ -414,7 +415,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd) 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)) { diff --git a/version.h b/version.h index 2e57f5b03f..84645eee00 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 324 +#define RUBY_PATCHLEVEL 325 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1