http://llvm.org/bugs/show_bug.cgi?id=8015
Ted Kremenek <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #5 from Ted Kremenek <[email protected]> 2010-09-01 18:29:20 CDT --- (In reply to comment #2) > Created an attachment (id=5423) --> (http://llvm.org/bugs/attachment.cgi?id=5423) [details] > Use UnknownVal for stack-based ElementRegions with non-constant indexes > I've gone ahead and applied this, since I think this is a good working base to suppress the false positive. We then should improve on from there. Patch applied here: http://llvm.org/viewvc/llvm-project?view=rev&revision=112766 In the patch I included a test case showing how this approach *doesn't* do the right thing: +// FIXME: This is a false positive due to not reasoning about symbolic +// array indices correctly. Discussion in PR 8015. +void pr8015_D_FIXME() { + int number = pr8015_A(); + const char *numbers[] = { "zero" }; + if (number == 0) { + if (numbers[number] == numbers[0]) + return; + int *p = 0; + *p = 0xDEADBEEF; // expected-warning{{Dereference of null pointer}} + } +} + Here we actually flag a bogus null dereference warning. I'm going to file a follow-up bug to track this one, and mark this as fixed since the false positive is gone. -- Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
