[analyzer]Fixup r156134: Handle the case when FunctionDecl isn't avail.

llvm-svn: 156183
This commit is contained in:
Anna Zaks 2012-05-04 17:37:16 +00:00
parent df7aad41fd
commit 63509fbacc
2 changed files with 7 additions and 1 deletions

View File

@ -139,7 +139,7 @@ bool CallOrObjCMessage::hasNonZeroCallbackArg() const {
FD = Ctor->getConstructor();
const CallExpr * CE = CallE.get<const CallExpr *>();
FD = dyn_cast<FunctionDecl>(CE->getCalleeDecl());
FD = dyn_cast_or_null<FunctionDecl>(CE->getCalleeDecl());
// If calling using a function pointer, assume the function does not
// have a callback. TODO: We could check the types of the arguments here.

View File

@ -829,6 +829,12 @@ void r11160612_6(StWithCallback St) {
dealocateMemWhenDoneByRef(&St, x);
}
int mySub(int, int);
int myAdd(int, int);
int fPtr(unsigned cond, int x) {
return (cond ? mySub : myAdd)(x, x);
}
// ----------------------------------------------------------------------------
// Below are the known false positives.