[clang] Fix a crash in constant evaluation of ExtVectorElementExprs (PR #136771)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 22 14:51:06 PDT 2025


================
@@ -9197,7 +9197,10 @@ bool LValueExprEvaluator::VisitExtVectorElementExpr(
 
   if (Success) {
     Result.setFrom(Info.Ctx, Val);
-    const auto *VT = E->getBase()->getType()->castAs<VectorType>();
+    QualType BaseType = E->getBase()->getType();
+    if (E->isArrow())
----------------
erichkeane wrote:

I'm a little surprised this isn't already handled in the AST.  I would expect the sub-expression to be a `dereference` of the vector type in the AST instead to having to do this (for the same reason that I would expect `*vecTyPtr` to have one).

https://github.com/llvm/llvm-project/pull/136771


More information about the cfe-commits mailing list