[clang] [clang] Save ShuffleVectorExpr args as ConstantExpr (PR #139709)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed May 14 12:00:56 PDT 2025


================
@@ -4566,9 +4566,11 @@ class ShuffleVectorExpr : public Expr {
 
   void setExprs(const ASTContext &C, ArrayRef<Expr *> Exprs);
 
-  llvm::APSInt getShuffleMaskIdx(const ASTContext &Ctx, unsigned N) const {
+  llvm::APSInt getShuffleMaskIdx(unsigned N) const {
     assert((N < NumExprs - 2) && "Shuffle idx out of range!");
----------------
shafik wrote:

I am looking at `NumExprs - 2` and I can't find where we ever assert or enforce `NumExprs` is always 2 or more.

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


More information about the cfe-commits mailing list