diff options
| author | George Karpenkov <ekarpenkov@apple.com> | 2018-12-11 01:13:20 +0000 |
|---|---|---|
| committer | George Karpenkov <ekarpenkov@apple.com> | 2018-12-11 01:13:20 +0000 |
| commit | 79ed11c12e02eb418543dffe05be36d72bb42766 (patch) | |
| tree | 18e3ddbec50c367162815a194af64d806a369d5f /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp | |
| parent | be5e5874f612adf6c64d06263776ec72349d3f4d (diff) | |
| download | bcm5719-llvm-79ed11c12e02eb418543dffe05be36d72bb42766.tar.gz bcm5719-llvm-79ed11c12e02eb418543dffe05be36d72bb42766.zip | |
[analyzer] Resolve another bug where the name of the leaked object was not printed properly
Differential Revision: https://reviews.llvm.org/D55528
llvm-svn: 348819
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp index b5828dbab28..d2dbcbdcd33 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp @@ -405,11 +405,11 @@ static AllocationInfo GetAllocationSite(ProgramStateManager &StateMgr, if (FB) { const MemRegion *R = FB.getRegion(); - const VarRegion *VR = R->getBaseRegion()->getAs<VarRegion>(); // Do not show local variables belonging to a function other than // where the error is reported. - if (!VR || VR->getStackFrame() == LeakContext->getStackFrame()) - FirstBinding = R; + if (auto MR = dyn_cast<StackSpaceRegion>(R->getMemorySpace())) + if (MR->getStackFrame() == LeakContext->getStackFrame()) + FirstBinding = R; } // AllocationNode is the last node in which the symbol was tracked. |

