[llvm-commits] [patch] More strict checking in LeakDetectorImpl::addGarbage
Nick Lewycky
nlewycky at google.com
Fri Dec 18 10:44:39 PST 2009
2009/12/17 Rafael Espindola <espindola at google.com>
> > OK for trunk?
>
> Actually, I think the attached patch is better. It catches more cases
> and is simpler.
>
Great catch!
Could you please write a unit test for this? It took me a while to figure
out what was wrong with the original code (even when it was obvious your
patch was correct). The case is:
addGarbage(A);
addGarbage(B);
addGarbage(A); // not caught as already in set...
removeGarbage(A); // ...unless this were remove(X) where X != A
though that would have to be a death test which only works in an asserts
build. See unittests/ADT/APIntTest.cpp for an example of a death test in
LLVM.
Nick
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091218/d8ff6940/attachment.html>
More information about the llvm-commits
mailing list