mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
Get rid of warnings/exceptions at cleanup
After the encoding index instance variable is removed when all instance variables are removed in `obj_free`, then `rb_str_free` causes uninitialized instance variable warning and nil-to-integer conversion exception. Both cases result in object allocation during GC, and crashes.
This commit is contained in:
parent
b1b155ff03
commit
fce667ed08
3 changed files with 14 additions and 0 deletions
|
@ -76,6 +76,9 @@ class TestEncoding < Test::Unit::TestCase
|
|||
assert_equal("0", format % 0)
|
||||
assert_equal(e, format.dup.encoding)
|
||||
assert_equal(e, (format*1).encoding)
|
||||
|
||||
assert_equal(e, (("x"*30).force_encoding(e)*1).encoding)
|
||||
GC.start
|
||||
end;
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue