diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-03 08:12:57 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-03 08:51:50 +0900 |
commit | 14a17063a11a01d518b4bbaf0eb967330aec3984 (patch) | |
tree | 5cc6a25e09b593f2bc5a66bef09b35f823075ebd /test/ruby | |
parent | 8bddf1bc9bdd1db7ce2e3fec15f2f06ff355b0a7 (diff) | |
download | ruby-14a17063a11a01d518b4bbaf0eb967330aec3984.tar.gz |
Fixed stack overflow [Bug #16382]
Get rid of infinite recursion in expanding a load path to the real
path while loading a transcoder.
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_encoding.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb index 40fd302c07..019cb2417f 100644 --- a/test/ruby/test_encoding.rb +++ b/test/ruby/test_encoding.rb @@ -123,4 +123,15 @@ class TestEncoding < Test::Unit::TestCase assert_include(e.message, "/regexp/sQ\n") end; end + + def test_nonascii_library_path + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}".force_encoding("US-ASCII")) + begin; + assert_equal(Encoding::US_ASCII, __ENCODING__) + $:.unshift("/\x80") + assert_raise_with_message(LoadError, /\[Bug #16382\]/) do + $:.resolve_feature_path "[Bug #16382]" + end + end; + end end |