]> granicus.if.org Git - clang/commit
[analyzer] RetainCountChecker: don't assume all functions have names.
authorJordan Rose <jordan_rose@apple.com>
Fri, 31 Aug 2012 18:19:18 +0000 (18:19 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 31 Aug 2012 18:19:18 +0000 (18:19 +0000)
commita89f719ad3a7134e3eec7c9e03aa0e22031c0de9
treee25c3c18ac0ec32de400e3d1ef5110851ee2af3d
parente4d90e14841e1e2d94701f65ad3f23a223fdaaca
[analyzer] RetainCountChecker: don't assume all functions have names.

Fixes a hard-to-reach crash when calling a non-member overloaded operator
with arguments that may be callbacks.

Future-proofing: don't make the same assumption in MallocSizeofChecker.
Aside from possibly respecting attributes in the future, it might be
possible to call 'malloc' through a function pointer.

I audited all other uses of FunctionDecl::getIdentifier() in the analyzer;
they all now correctly test to see if the identifier is present before
using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163012 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
test/Analysis/retain-release.mm