[llvm] Fix overflow issues associated with shufflevector for landing PR #229662 (PR #230410)

Sushant Gokhale via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 19:09:33 PDT 2026


================
@@ -1962,7 +1962,7 @@ static bool isSingleSourceMaskImpl(ArrayRef<int> Mask, int NumOpElts) {
   for (int I : Mask) {
     if (I == -1)
       continue;
-    assert(I >= 0 && I < (NumOpElts * 2) &&
+    assert(I >= 0 && I < ((int64_t)NumOpElts * 2) &&
----------------
sushgokh wrote:

I think that makes also makes sense for the reason that its static method and it wont be called from outside with NumOpElts > INT_MAX.
Changed NumOpElts  to int64_t.

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


More information about the llvm-commits mailing list