summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-06 10:42:10 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-06 10:42:10 (GMT)
commit6a5cdfacbf2577e86a84555b24ba2cbc03bfa394 (patch)
tree3a7e6f279118f2548050c4fb2c89f07c6f11c7d2 /re.c
parent8d004969118b06d0057841f2e89ddfd0807ad765 (diff)
* 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/re.c b/re.c
index 9258f83..588eb9c 100644
--- a/re.c
+++ b/re.c
@@ -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 {