[clang] [analyzer] Harden RegionStoreManager::bindArray (PR #153177)
Marco Borgeaud via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 18 23:53:16 PDT 2025
================
@@ -2654,14 +2654,19 @@ RegionStoreManager::bindArray(LimitedRegionBindingsConstRef B,
SVal V = getBinding(B.asStore(), *MRV, R->getValueType());
return bindAggregate(B, R, V);
}
+ if (auto const *Value = Init.getAsInteger()) {
+ auto SafeValue = StateMgr.getBasicVals().getValue(*Value);
+ return bindAggregate(B, R, nonloc::ConcreteInt(SafeValue));
+ }
- // Handle lazy compound values.
+ // Handle lazy compound values and symbolic values.
----------------
marco-antognini-sonarsource wrote:
@NagyDonat Thanks for the feedback on this PR -- I'll come back to it as soon as I have a bit of time. Regarding this specific comment, it's inspired by `RegionStoreManager::bindStruct`. The intent was to keep it uniform but since it is not obvious, I'll remove it.
https://github.com/llvm/llvm-project/pull/153177
More information about the cfe-commits
mailing list