* marshal.c (w_object): add flonum to arg->data to keep reference index
consistency. [ruby-core:49323] [Bug #7348] * test/ruby/test_marshal.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6379b316bb
commit
f45f668fa1
@ -1,3 +1,10 @@
|
|||||||
|
Sat Nov 17 00:50:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (w_object): add flonum to arg->data to keep reference index
|
||||||
|
consistency. [ruby-core:49323] [Bug #7348]
|
||||||
|
|
||||||
|
* test/ruby/test_marshal.rb: add a test for above.
|
||||||
|
|
||||||
Sat Nov 17 00:40:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Nov 17 00:40:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* common.mk (incs): dist files need probes.dmyh.
|
* common.mk (incs): dist files need probes.dmyh.
|
||||||
|
@ -637,6 +637,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
|
|||||||
w_symbol(SYM2ID(obj), arg);
|
w_symbol(SYM2ID(obj), arg);
|
||||||
}
|
}
|
||||||
else if (FLONUM_P(obj)) {
|
else if (FLONUM_P(obj)) {
|
||||||
|
st_add_direct(arg->data, obj, arg->data->num_entries);
|
||||||
w_byte(TYPE_FLOAT, arg);
|
w_byte(TYPE_FLOAT, arg);
|
||||||
w_float(RFLOAT_VALUE(obj), arg);
|
w_float(RFLOAT_VALUE(obj), arg);
|
||||||
}
|
}
|
||||||
|
@ -492,4 +492,11 @@ class TestMarshal < Test::Unit::TestCase
|
|||||||
assert_equal(Rational(1, 2), Marshal.load("\x04\bU:\rRational[\ai\x06i\a"))
|
assert_equal(Rational(1, 2), Marshal.load("\x04\bU:\rRational[\ai\x06i\a"))
|
||||||
assert_raise(ArgumentError){Marshal.load("\x04\bU:\rRational[\bi\x00i\x00i\x00")}
|
assert_raise(ArgumentError){Marshal.load("\x04\bU:\rRational[\bi\x00i\x00i\x00")}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_marshal_flonum_reference
|
||||||
|
bug7348 = '[ruby-core:49323]'
|
||||||
|
e = []
|
||||||
|
ary = [ [2.0, e], [e] ]
|
||||||
|
assert_equal(ary, Marshal.load(Marshal.dump(ary)), bug7348)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user