[clang] [Clang] fix crash when constexpr evaluation encounters uninitialized GCC vector (PR #180293)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 9 00:57:26 PST 2026
================
@@ -4291,7 +4296,20 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj,
ObjType = VT->getElementType();
assert(I == N - 1 && "extracting subobject of scalar?");
- return handler.found(O->getVectorElt(Index), ObjType);
+
+ if (O->isIndeterminate() || O->isAbsent()) {
+ if (isRead(handler.AccessKind)) {
+ Info.FFDiag(E);
+ return handler.failed();
+ }
+ expandVector(*O, NumElements);
+ }
+
+ if (O->isVector())
----------------
Fznamznon wrote:
I think this `if` should be an `assert` instead.
https://github.com/llvm/llvm-project/pull/180293
More information about the cfe-commits
mailing list