diff options
author | Gabor Marton <gabor.marton@ericsson.com> | 2019-07-04 11:39:00 +0000 |
---|---|---|
committer | Gabor Marton <gabor.marton@ericsson.com> | 2019-07-04 11:39:00 +0000 |
commit | e712295f11bb90d38c8749a338293eaba06d96a5 (patch) | |
tree | 71dfdb6eed06a5defa3e5327bfa7d768e03bae84 /clang/lib/StaticAnalyzer/Core/CallEvent.cpp | |
parent | 04531ba3a288086fc01e469af2fa07191df8edd0 (diff) | |
download | bcm5719-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.cpp | 5 |
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 |