1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* regenc.c (code_to_mbc): raise RangeError Integer#chr

when more than 255 is given with single byte encoding.
  [ruby-dev:35789]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-08-06 20:17:55 +00:00
parent d8353d6b6e
commit 420e61cf0b
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Thu Aug 7 05:14:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
* regenc.c (code_to_mbc): raise RangeError Integer#chr
when more than 255 is given with single byte encoding.
[ruby-dev:35789]
Thu Aug 7 05:06:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (run_final): runs finalizers with the object terminated.

View file

@ -629,6 +629,8 @@ onigenc_single_byte_code_to_mbclen(OnigCodePoint code ARG_UNUSED, OnigEncoding e
extern int
onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
{
if (code > 0xff)
rb_raise(rb_eRangeError, "%"PRIdVALUE " out of char range", code);
*buf = (UChar )(code & 0xff);
return 1;
}