diff options
author | DonĂ¡t Nagy <donat.nagy@ericsson.com> | 2025-08-01 16:39:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-01 16:39:56 +0200 |
commit | be03d257cdc29172a7b4b35f85d3242fddba1d43 (patch) | |
tree | 21d5989b7501a5f4c5b05694e5a149efd8e34038 /llvm/lib/Object/Object.cpp | |
parent | 6b7a8e9015fad3f73b37e517d9189cbf98feb5d1 (diff) | |
download | llvm-be03d257cdc29172a7b4b35f85d3242fddba1d43.zip llvm-be03d257cdc29172a7b4b35f85d3242fddba1d43.tar.gz llvm-be03d257cdc29172a7b4b35f85d3242fddba1d43.tar.bz2 |
[analyzer] Retain address space information in getElementRegion (#151370)
The factory method `MemRegionManager::getElementRegion()` is the main
way of constructing `ElementRegion` objects, which are widespread in the
analysis and may represent array elements (as lvalues), pointer
arithmetic and type conversions.
This factory method used to strip all qualifiers from the type
associated with the element (after canonicalizing it), but the address
space qualifier can affect the size of a pointer type, so stripping it
caused an assertion failure (in `evalBinOpLL`):
clang: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:785: void
assertEqualBitWidths(clang::ento::ProgramStateRef, clang::ento::Loc,
clang::ento::Loc): Assertion `RhsBitwidth == LhsBitwidth && "RhsLoc and
LhsLoc bitwidth must be same!"' failed.
---------
Co-authored-by: Vince Bridgers <vince.a.bridgers@ericsson.com>
Diffstat (limited to 'llvm/lib/Object/Object.cpp')
0 files changed, 0 insertions, 0 deletions