[clang] [analyzer] Add aggregate value tracking to the LifetimeModeling checker (PR #214823)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 02:57:39 PDT 2026
================
@@ -105,6 +105,69 @@ std::string lifetime_modeling::getRegionName(const MemRegion *Reg) {
return "the region";
}
+namespace clang::ento::lifetime_modeling {
+
+static SmallVector<const MemRegion *, 4>
+getRegionsFromAggrVal(nonloc::LazyCompoundVal LCV, CheckerContext &C) {
+ SmallVector<const MemRegion *, 4> Reg;
+
+ const TypedValueRegion *LCVRegion = LCV.getRegion();
+ QualType T = LCVRegion->getValueType();
+ MemRegionManager &MemMgr = C.getSValBuilder().getRegionManager();
+ StoreManager &StoreMgr = C.getState()->getStateManager().getStoreManager();
+
+ // FIXME: getAsRecordDecl() also includes unions which need different
+ // handling while also returning null on array aggregate types. Reading a
+ // binding for every member of a union may produce regions that are not
----------------
isuckatcs wrote:
We might disable handling of unions for now. Just in case to avoid false positives.
https://github.com/llvm/llvm-project/pull/214823
More information about the cfe-commits
mailing list