Actions
Bug #1709
closedMarshal.dump Uses Different Definition of 'Depth' on 1.9?
    Bug #1709:
    Marshal.dump Uses Different Definition of 'Depth' on 1.9?
  
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-06-27 trunk 23871) [i686-linux]
Backport:
Description
=begin
Marshal.dump issues an "exceed depth limit" on 1.9 when the same data structure with the same depth dumps correctly on 1.8.
 $ ruby8 -ve "h={'one'=>{'two'=>{'three'=>0}}}; p Marshal.dump(h,4)"
 ruby 1.8.8dev (2009-06-28) [i686-linux]
 "\004\b{\006\"\bone{\006\"\btwo{\006\"\nthreei\000"
 $ ruby -ve "h={'one'=>{'two'=>{'three'=>0}}}; p Marshal.dump(h,4)"
 ruby 1.9.2dev (2009-06-27 trunk 23871) [i686-linux]
 -e:1:in `dump': exceed depth limit (ArgumentError)
from -e:1:in `<main>'
 $ ruby -ve "h={'one'=>{'two'=>{'three'=>0}}}; p Marshal.dump(h,5)"
 ruby 1.9.2dev (2009-06-27 trunk 23871) [i686-linux]
 "\x04\b{\x06I\"\bone\x06:\x06ET{\x06I\"\btwo\x06;\x00T{\x06I\"\nthree\x06;\x00Ti\x00"
Is this difference intentional? If so, how is 'depth' defined on 1.9?
=end
Actions