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

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 22 19:20:42 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())
----------------
ahatanak wrote:

Is `sub-expression` the base expression in this case? For `ExtVectorElementExpr`, the base expression is whatever the LHS of `->` or `.` is and that decision was made a long time ago. I think `MemberExpr`'s base expression can be a pointer type too.

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


More information about the cfe-commits mailing list