[clang] [SSAF][UnsafeBufferAnalysis] Filter out type-constrained pointers from reachable unsafe pointers (PR #209354)

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 18:58:17 PDT 2026


================
@@ -103,23 +103,19 @@ AnalysisDriver::toposort(llvm::ArrayRef<AnalysisName> Roots) {
 llvm::Error AnalysisDriver::executeSummaryAnalysis(SummaryAnalysisBase &Summary,
                                                    WPASuite &Suite) const {
   SummaryName SN = Summary.getSummaryName();
-  auto DataIt = LU->Data.find(SN);
-  if (DataIt == LU->Data.end()) {
-    return ErrorBuilder::create(std::errc::invalid_argument,
-                                "no data for analysis '{0}' in LUSummary",
-                                Summary.getAnalysisName())
-        .build();
-  }
 
   if (auto Err = Summary.initialize()) {
     return Err;
   }
 
-  for (auto &[Id, EntitySummary] : DataIt->second) {
-    if (auto Err = Summary.add(Id, *EntitySummary)) {
-      return Err;
+  auto DataIt = LU->Data.find(SN);
----------------
ziqingluo-90 wrote:

@aviralg I think dependent analysis results should be allowed to be empty.  In this case, `UnsafeBufferReachableAnalysis` depends on `TypeConstrainedPointersAnalysisResult`, which is empty when there are no new/delete overloaded functions or `main` functions.   Likewise,  other dependent analysis results can also be empty, in very rare cases.  The analysis should proceed normally in these cases.

https://github.com/llvm/llvm-project/pull/209354


More information about the cfe-commits mailing list