Skip to content

Understand why validate didn't complain after a change #2

Description

@jmct

validate in src/Data/Pak/INodeTable.hs is probably wrong, but I can't think of how yet.

My evidence is that we changed the following:

--- a/src/Data/Pak/INodeTable.hs
+++ b/src/Data/Pak/INodeTable.hs
@@ -61,7 +61,7 @@ getFreePages vec = V.toList (V.map fromIntegral (V.elemIndices 3 vec))
 
 followFile :: Vector Word16 -> Word16 -> INodeParser [Word16]
 followFile v s =
- do put []
+ do put [s]
     if (s == 0)
     then pure []
     else followINodes v s

Which should change the length of the INode Chain, but validate didn't complain!

validate is only meant to accept the input if it's 256 bytes, but if this changes the length it either wasn't 256 bytes before or after (or both!) but validate didn't say anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions