[clang] [clang][ExprConst] Check record base classes for valid structs (PR #132270)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 20 11:32:16 PDT 2025
================
@@ -7385,8 +7385,13 @@ class APValueToBufferConverter {
for (size_t I = 0, E = CXXRD->getNumBases(); I != E; ++I) {
const CXXBaseSpecifier &BS = CXXRD->bases_begin()[I];
CXXRecordDecl *BaseDecl = BS.getType()->getAsCXXRecordDecl();
+ const APValue &Base = Val.getStructBase(I);
- if (!visitRecord(Val.getStructBase(I), BS.getType(),
+ // Can happen in error cases.
+ if (!Base.isStruct())
----------------
erichkeane wrote:
Curious what `Base` ends up being here? Are we putting a NULL in here or something?
https://github.com/llvm/llvm-project/pull/132270
More information about the cfe-commits
mailing list