Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

static-analyzer fails to see exit() in function w/ varargs resulting in a false positive #12790

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR12685
Status NEW
Importance P normal
Reported by nega@icecube.umd.edu
Reported on 2012-04-27 10:34:02 -0700
Last modified on 2012-04-27 15:42:06 -0700
Version unspecified
Hardware Macintosh MacOS X
CC kremenek@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments foo.c (390 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 8467
sample code demonstrating the bug.

Using check-264.tar.bz2 from http://clang-analyzer.llvm.org/

In the attached code, the call to memcpy() on line 26 is clearly an error, but
is never reached because of the preceding call to die() on line 23. 'scan-
build' flags line 26 as an error.

Changing the call to die() on link 23 to die0() results in the expected
behavior from scan-build; scan-build does not flag line 26 as an error.

Of course, declaring die() with "__attribute__ ((noreturn))" results in the
expected behavior; scan-build does not flag line 26 as an error.
Quuxplusone commented 12 years ago

Attached foo.c (390 bytes, application/octet-stream): sample code demonstrating the bug.

Quuxplusone commented 12 years ago

cloned to rdar://problem/11338586