summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorGabor Marton <gabor.marton@ericsson.com>2019-07-04 11:39:00 +0000
committerGabor Marton <gabor.marton@ericsson.com>2019-07-04 11:39:00 +0000
commite712295f11bb90d38c8749a338293eaba06d96a5 (patch)
tree71dfdb6eed06a5defa3e5327bfa7d768e03bae84 /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parent04531ba3a288086fc01e469af2fa07191df8edd0 (diff)
downloadbcm5719-llvm-e712295f11bb90d38c8749a338293eaba06d96a5.tar.gz
bcm5719-llvm-e712295f11bb90d38c8749a338293eaba06d96a5.zip
[CTU] Add support for virtual functions
Reviewers: Szelethus, xazax.hun Subscribers: rnkovacs, dkrupp, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63920 llvm-svn: 365133
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 81a9ee4d90b..a5f7500e630 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -766,8 +766,11 @@ RuntimeDefinition CXXInstanceCall::getRuntimeDefinition() const {
// Does the decl that we found have an implementation?
const FunctionDecl *Definition;
- if (!Result->hasBody(Definition))
+ if (!Result->hasBody(Definition)) {
+ if (!DynType.canBeASubClass())
+ return AnyFunctionCall::getRuntimeDefinition();
return {};
+ }
// We found a definition. If we're not sure that this devirtualization is
// actually what will happen at runtime, make sure to provide the region so
OpenPOWER on IntegriCloud