[llvm] aa4c655 - [SandboxIR] Fix use-of-uninitialized in ShuffleVectorInst unit test. (#105592)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 15:23:46 PDT 2024


Author: Jorge Gorbe Moya
Date: 2024-08-21T15:23:42-07:00
New Revision: aa4c6557a1281df627cdf06684bdb08da2707200

URL: https://github.com/llvm/llvm-project/commit/aa4c6557a1281df627cdf06684bdb08da2707200
DIFF: https://github.com/llvm/llvm-project/commit/aa4c6557a1281df627cdf06684bdb08da2707200.diff

LOG: [SandboxIR] Fix use-of-uninitialized in ShuffleVectorInst unit test. (#105592)

I accidentally created a dangling ArrayRef local variable. Use a
SmallVector instead.

Added: 
    

Modified: 
    llvm/unittests/SandboxIR/SandboxIRTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/SandboxIR/SandboxIRTest.cpp b/llvm/unittests/SandboxIR/SandboxIRTest.cpp
index 94d8ac27be3bc8..8315ee38dbe187 100644
--- a/llvm/unittests/SandboxIR/SandboxIRTest.cpp
+++ b/llvm/unittests/SandboxIR/SandboxIRTest.cpp
@@ -801,7 +801,7 @@ define void @foo(<2 x i8> %v1, <2 x i8> %v2) {
   // isValidOperands
   auto *LLVMArgV1 = LLVMF.getArg(0);
   auto *LLVMArgV2 = LLVMF.getArg(1);
-  ArrayRef<int> Mask({1, 2});
+  SmallVector<int, 2> Mask({1, 2});
   EXPECT_EQ(
       sandboxir::ShuffleVectorInst::isValidOperands(ArgV1, ArgV2, Mask),
       llvm::ShuffleVectorInst::isValidOperands(LLVMArgV1, LLVMArgV2, Mask));


        


More information about the llvm-commits mailing list