Marshal.dump depth limit off by one
Reported by Justin Bradford | January 15th, 2008 @ 06:58 PM | in 1.0 preview
This should fix the marshal/dump_spec failure.
Comments and changes to this ticket
-

Justin Bradford January 15th, 2008 @ 08:23 PM
Arg. Nevermind, this triggers to early now. Ignore this patch.
-

Justin Bradford January 15th, 2008 @ 08:28 PM
Ah, it was an error in the spec. It was testing for an error on a valid depth. Later error tests had the correct count, so the new patch simple fixes the spec.
-

Jeremy Roach January 15th, 2008 @ 09:28 PM
The two lines you're replacing in marshall-depth-spec-error.patch pass under ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux].
-

Justin Bradford January 15th, 2008 @ 09:54 PM
How can those lines pass, and the later null checks, too? The depth count is entirely inconsistent...
-

Justin Bradford January 15th, 2008 @ 10:04 PM
The only possibility is that hashes have different depths than arrays... With three nested hashes, does the last assignment count as a new depth level? But not for items in an array?
Perhaps it is just that the depth of [0] is greater than the depth of []? Or equivalently, the depth of {:a => :b} is one greater than {}?
To be clear, rubinius' goal is to meet MRI spec, not to make more sense, right? If so, this patch is wrong, and requires additional depth counting logic on array/hash marshal functions.
-

Justin Bradford January 15th, 2008 @ 10:15 PM
This new patch restores the spec definition and gives compliant MRI behavior.
-

-
Brian Ford January 20th, 2008 @ 12:48 PM
- → State changed from new to resolved
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
