forked from OSchip/llvm-project
[analyzer]Fixup r156134: Handle the case when FunctionDecl isn't avail.
llvm-svn: 156183
This commit is contained in:
parent
df7aad41fd
commit
63509fbacc
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue