mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
Fixed stack overflow [Bug #16382]
Get rid of infinite recursion in expanding a load path to the real path while loading a transcoder.
This commit is contained in:
parent
8bddf1bc9b
commit
14a17063a1
Notes:
git
2019-12-03 10:16:57 +09:00
4 changed files with 31 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue