diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-23 19:18:57 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-23 19:18:57 +0000 |
commit | 2e081760e3007505ac821869a15ca2922b88b4f9 (patch) | |
tree | 22705ae3d1c5bdce7f92e74913094d317d483d6e /test | |
parent | 55849b02bd0c3caba2bda4e6141a528861ea8526 (diff) |
merge revision(s) 50057,50065: [Backport #10991]
* marshal.c (r_symreal): register symbol names as strings first so
that r_symlink always returns valid names.
[ruby-core:68587] [Bug #10991]
* marshal.c (r_ivar, r_object0): now need to intern symbol names.
* marshal.c (r_object0): compare with symbol names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_marshal.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 9b82d52233..3d5d6c9b1f 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -252,6 +252,17 @@ class TestMarshal < Test::Unit::TestCase assert_include(Marshal.dump([:a, :a]), ';') end + def test_symlink_in_ivar + bug10991 = '[ruby-core:68587] [Bug #10991]' + sym = Marshal.load("\x04\x08" + + "I" ":\x0bKernel" + + ("\x06" + + ("I" ":\x07@a" + + ("\x06" ":\x07@b" "e;\x0""o:\x0bObject""\x0")) + + "0")) + assert_equal(:Kernel, sym, bug10991) + end + ClassUTF8 = eval("class R\u{e9}sum\u{e9}; self; end") iso_8859_1 = Encoding::ISO_8859_1 |