Skip to content

Commit dbcf8b4

Browse files
LoboQ1ngNagyDonat
andauthored
Update clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
Co-authored-by: Donát Nagy <[email protected]>
1 parent a19a454 commit dbcf8b4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,13 +3156,7 @@ void MallocChecker::checkPreCall(const CallEvent &Call,
31563156
for (unsigned I = 0, E = Call.getNumArgs(); I != E; ++I) {
31573157
SVal ArgSVal = Call.getArgSVal(I);
31583158
if (isa<Loc>(ArgSVal)) {
3159-
const MemRegion *MR = ArgSVal.getAsRegion();
3160-
if (!MR)
3161-
continue;
3162-
const MemRegion *BaseRegion = MR->getBaseRegion();
3163-
SymbolRef Sym = nullptr;
3164-
if (const auto *SR = dyn_cast<SymbolicRegion>(BaseRegion))
3165-
Sym = SR->getSymbol();
3159+
SymbolRef Sym = ArgSVal.getAsSymbol(/*IncludeBaseRegions=*/true);
31663160
if (!Sym)
31673161
continue;
31683162
if (checkUseAfterFree(Sym, C, Call.getArgExpr(I)))

0 commit comments

Comments
 (0)