Project

General

Profile

Actions

Bug #11387

closed

String#force_encoding と String#reverse の後にSEGV

Added by tatzyr (Tatsuya Otsuka) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-07-22 trunk 51342) [x86_64-darwin14]
[ruby-dev:49189]

Description

以下のコードでSEGVします。

broken_str = "abcd\xf0"
broken_str.force_encoding("utf-8").reverse
p broken_str.reverse

また、以下のコードでは String#splitArgumentError (invalid byte sequence in UTF-8)
発生することが期待されますが、実際は例外が発生しません。

broken_str = "abcd\xf0"
broken_str.force_encoding("utf-8").reverse
"".split(broken_str)

Files

stdout-and-stderr.txt (3.97 KB) stdout-and-stderr.txt tatzyr (Tatsuya Otsuka), 07/22/2015 01:28 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0