forked from OSchip/llvm-project
[analyzer] Quickfix: don't crash when runtime definition is not available.
llvm-svn: 326230
This commit is contained in:
parent
fa5d70e623
commit
482bf0f531
|
@ -321,9 +321,11 @@ private:
|
|||
/// Get parameters associated with runtime definition in order
|
||||
/// to get the correct parameter name.
|
||||
ArrayRef<ParmVarDecl *> getCallParameters(CallEventRef<> Call) {
|
||||
if (isa<FunctionDecl>(Call->getDecl()))
|
||||
return dyn_cast<FunctionDecl>(Call->getRuntimeDefinition().getDecl())
|
||||
->parameters();
|
||||
// Use runtime definition, if available.
|
||||
RuntimeDefinition RD = Call->getRuntimeDefinition();
|
||||
if (auto *FD = dyn_cast_or_null<FunctionDecl>(RD.getDecl()))
|
||||
return FD->parameters();
|
||||
|
||||
return Call->parameters();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue