aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorDonatNagyE <donat.nagy@ericsson.com>2023-10-09 13:56:20 +0200
committerGitHub <noreply@github.com>2023-10-09 13:56:20 +0200
commit2856e729f3640c500499a84fb741b15775e529cf (patch)
treeacdfb96a52f4dc8af5f917659f55216b2d343674 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent6afbc09e7e78eb6dc397a687c41e6fdcb329af77 (diff)
downloadllvm-2856e729f3640c500499a84fb741b15775e529cf.zip
llvm-2856e729f3640c500499a84fb741b15775e529cf.tar.gz
llvm-2856e729f3640c500499a84fb741b15775e529cf.tar.bz2
[analyzer][NFC] Remove outdated FIXME comment (#68211)
This trivial commit removes a 13-year-old FIXME comment from MallocChecker.cpp because it was fixed at least 10 years ago when `getConjuredHeapSymbolVal()` was added.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 18c7f3e..d3a4020 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -1961,13 +1961,10 @@ ProgramStateRef MallocChecker::FreeMemAux(
// Parameters, locals, statics, globals, and memory returned by
// __builtin_alloca() shouldn't be freed.
if (!isa<UnknownSpaceRegion, HeapSpaceRegion>(MS)) {
- // FIXME: at the time this code was written, malloc() regions were
- // represented by conjured symbols, which are all in UnknownSpaceRegion.
- // This means that there isn't actually anything from HeapSpaceRegion
- // that should be freed, even though we allow it here.
- // Of course, free() can work on memory allocated outside the current
- // function, so UnknownSpaceRegion is always a possibility.
- // False negatives are better than false positives.
+ // Regions returned by malloc() are represented by SymbolicRegion objects
+ // within HeapSpaceRegion. Of course, free() can work on memory allocated
+ // outside the current function, so UnknownSpaceRegion is also a
+ // possibility here.
if (isa<AllocaRegion>(R))
HandleFreeAlloca(C, ArgVal, ArgExpr->getSourceRange());