diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-06 10:42:10 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-06 10:42:10 +0000 |
commit | 6a5cdfacbf2577e86a84555b24ba2cbc03bfa394 (patch) | |
tree | 3a7e6f279118f2548050c4fb2c89f07c6f11c7d2 /re.c | |
parent | 8d004969118b06d0057841f2e89ddfd0807ad765 (diff) | |
download | ruby-6a5cdfacbf2577e86a84555b24ba2cbc03bfa394.tar.gz |
* re.c (unescape_nonascii): cast -1 for the case char is unsigned char.
If char is signed char, for example gcc for ARM or ppc64, it caused
infinite loop.
http://kmuto.jp/build-ruby/arm/ruby-trunk/log/20141106T013005Z.fail.html.gz
http://rubyci.blob.core.windows.net/f19p8/ruby-trunk/log/20141106T090217Z.fail.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2286,7 +2286,7 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc, p = p-2; if (enc == rb_usascii_encoding()) { c = read_escaped_byte(&p, end, err); - if (c == -1) return -1; + if (c == (char)-1) return -1; rb_str_buf_cat(buf, &c, 1); } else { |