Le-Chun added the additional routine to remove pointers from a set; that code is unique to annotalysis. I can't easily include a test case, because the bug is difficult to trigger. It occurs only when there is a hash collision between two pointers in the set, and the first pointer is removed before the second. I do have a test case, but it will only work for my particular build on my machine, since the actual pointer addresses involved will change as soon as you touch something. I could write a unit test using bogus pointer values that are engineered to trigger a collision, but it wouldn't be a normal compiler test case; where would I put it?
-DeLesley On Tue, Jul 26, 2011 at 5:59 PM, Diego Novillo <dnovi...@google.com> wrote: > On Tue, Jul 26, 2011 at 16:13, Delesley Hutchins <deles...@google.com> 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. > > Could you include a test case? It's not clear to me what you are > fixing and when this happens. Is this a bug in trunk as well? The > pointer-set implementation has been around for a while, so I'm > surprised that you are running into this now. Or is this something > that only happens with the pointer set changes we have in for > annotalysis? > > > Thanks. Diego. > -- DeLesley Hutchins | Software Engineer | deles...@google.com | 505-206-0315