fsck: don't put a void*-shaped peg in a char*-shaped hole
authorMichael Haggerty <mhagger@alum.mit.edu>
Sat, 25 May 2013 09:08:11 +0000 (11:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 May 2013 16:25:01 +0000 (09:25 -0700)
The source of this nonsense was

04d3975937 fsck: reduce stack footprint

, which wedged a pointer to parent into the object_array_entry's name
field. The parent pointer was passed to traverse_one_object(), even
though that function *didn't use it*.

The useless code has been deleted over time. Commit

a1cdc25172 fsck: drop unused parameter from traverse_one_object()

removed the parent pointer from traverse_one_object()'s
signature. Commit

c0aa335c95 Remove unused variables

removed the code that read the parent pointer back out of the name
field.

This commit takes the last step: don't write the parent pointer into
the name field in the first place.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
index bb9a2cd44722dc27d54aa5451278a10f512becb8..9909b6d519f0a7d3d3b53313e7886c9482d98ba5 100644 (file)
@@ -112,7 +112,7 @@ static int mark_object(struct object *obj, int type, void *data)
                return 1;
        }
 
-       add_object_array(obj, (void *) parent, &pending);
+       add_object_array(obj, NULL, &pending);
        return 0;
 }