diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-15 06:52:36 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-15 06:52:36 +0000 |
commit | c358a4cba1064162b5c78e4919aca77fd249e844 (patch) | |
tree | 5d4f442e5823802cc25ecd233e93d04248578c96 /ext/json | |
parent | 67bf09903f9391181841f3a6194282dd43c05ff2 (diff) | |
download | ruby-c358a4cba1064162b5c78e4919aca77fd249e844.tar.gz |
* 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/trunk@34306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json')
-rw-r--r-- | ext/json/parser/parser.c | 2 | ||||
-rw-r--r-- | ext/json/parser/parser.rl | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index d1d14c79ca..1773616463 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -1293,6 +1293,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 == '\\') { @@ -1325,7 +1326,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 e7d47e1589..33e775ce72 100644 --- a/ext/json/parser/parser.rl +++ b/ext/json/parser/parser.rl @@ -393,6 +393,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 == '\\') { @@ -425,7 +426,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)) { |