[clang] 2856e72 - [analyzer][NFC] Remove outdated FIXME comment (#68211)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 04:56:24 PDT 2023


Author: DonatNagyE
Date: 2023-10-09T13:56:20+02:00
New Revision: 2856e729f3640c500499a84fb741b15775e529cf

URL: https://github.com/llvm/llvm-project/commit/2856e729f3640c500499a84fb741b15775e529cf
DIFF: https://github.com/llvm/llvm-project/commit/2856e729f3640c500499a84fb741b15775e529cf.diff

LOG: [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.

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 18c7f3e4f6e6b92..d3a4020280616b0 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());


        


More information about the cfe-commits mailing list