Re: [PATCH 1/8] fixup! combine_diff: simplify intersect_paths() further

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kirill Smelkov <kirr@xxxxxxxxxx> writes:

> That cleanup patch is good, but I've found a bug in it. In the item removal
> code
>
>> +                      /* p->path not in q->queue[]; drop it */
>> +                      struct combine_diff_path *next = p->next;
>> +
>> +                      if ((*tail = next) != NULL)
>> +                              tail = &next->next;
>> +                      free(p);
>>                        continue;
>
>         *tail = next
>
> is right, but
>
>         tail = &next->next
>
> is wrong,

Heh, surely.  We just have skipped, and the fact that tail points at
the pointer variable that points at the first of the remaining items
does not change with this skipping of next by assigning it to *tail.  
An extra assignment to tail will skip one more, which is unnecessary.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]