Skip to content

Commit

Permalink
[NFCI] update formating for misleading indentation warning
Browse files Browse the repository at this point in the history
Reviewers: xbolva00

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D70861
  • Loading branch information
Ralender committed Dec 3, 2019
1 parent 3953540 commit 2f96047
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
Expand Up @@ -2525,19 +2525,18 @@ MallocChecker::LeakInfo MallocChecker::getAllocationSite(const ExplodedNode *N,

// Find the most recent expression bound to the symbol in the current
// context.
if (!ReferenceRegion) {
if (const MemRegion *MR = C.getLocationRegionIfPostStore(N)) {
SVal Val = State->getSVal(MR);
if (Val.getAsLocSymbol() == Sym) {
const VarRegion* VR = MR->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()))
ReferenceRegion = MR;
}
if (!ReferenceRegion) {
if (const MemRegion *MR = C.getLocationRegionIfPostStore(N)) {
SVal Val = State->getSVal(MR);
if (Val.getAsLocSymbol() == Sym) {
const VarRegion *VR = MR->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()))
ReferenceRegion = MR;
}
}
}

// Allocation node, is the last node in the current or parent context in
// which the symbol was tracked.
Expand Down

0 comments on commit 2f96047

Please sign in to comment.