]> granicus.if.org Git - clang/commit
[analyzer] Make MallocChecker more robust against custom redeclarations
authorDevin Coughlin <dcoughlin@apple.com>
Sun, 16 Oct 2016 17:26:06 +0000 (17:26 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Sun, 16 Oct 2016 17:26:06 +0000 (17:26 +0000)
commit075094416be54004403f099d6671799c442bd6b6
tree759e677ee9f149610e39ea427166efdebe41c58a
parent93238dfb22fa5a717809c2c49eac444913cf5596
[analyzer] Make MallocChecker more robust against custom redeclarations

Add additional checking to MallocChecker to avoid crashing when memory
routines have unexpected numbers of arguments. You wouldn't expect to see much
of this in normal code (-Wincompatible-library-redeclaration warns on this),
but, for example, CMake tests can generate these.

This is PR30616.

rdar://problem/28631974

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284335 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
test/Analysis/malloc-custom.c [new file with mode: 0644]