This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [google] [annotalysis] Fix remove operation from pointer_set in case of hash collisions
- From: Richard Henderson <rth at redhat dot com>
- To: Delesley Hutchins <delesley at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Diego Novillo <dnovillo at google dot com>
- Date: Thu, 28 Jul 2011 12:22:13 -0700
- Subject: Re: [PATCH] [google] [annotalysis] Fix remove operation from pointer_set in case of hash collisions
- References: <CAF6KqwWcuO+kLjOKfRKK6_bWtPKSnU2JvLv1sU2N+gxtCUVFYA@mail.gmail.com>
On 07/26/2011 04:13 PM, Delesley Hutchins wrote:
> This patch fixes a bug in pointer_set.c, where removing a pointer from
> a pointer set would corrupt the hash table if the pointer was involved
> in any hash collisions.
>
> Bootstrapped and passed gcc regression testsuite on x86_64-unknown-linux-gnu.
>
> Okay for google/gcc-4_6?
>
> -DeLesley
>
> gcc/Changelog.annotalysis:
> 2011-7-26 DeLesley Hutchins <delesley@google.com>
>
> * gcc/pointer-set.c (pointer_set_delete) bugfix for case of
> hash collisions
The logic of the patch looks good. I certainly agree it's a real bug.
> + /* find location of p */
But please fix up all the comments to be properly punctuated sentences.
> + pset->slots[n] = 0; /* remove ptr from set. */
And avoid end-of-line comments. Put it on the previous line.
r~