[Mlir-commits] [mlir] 2950876 - [mlir] Fix windows build bot break due to use of `alloca` in a test.

Stella Laurenzo llvmlistbot at llvm.org
Mon May 10 13:43:20 PDT 2021


Author: Stella Laurenzo
Date: 2021-05-10T20:39:16Z
New Revision: 295087644a468c47a1dbfaca2b5ea552204ab35f

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

LOG: [mlir] Fix windows build bot break due to use of `alloca` in a test.

Differential Revision: https://reviews.llvm.org/D102189

Added: 
    

Modified: 
    mlir/test/CAPI/sparse_tensor.c

Removed: 
    


################################################################################
diff  --git a/mlir/test/CAPI/sparse_tensor.c b/mlir/test/CAPI/sparse_tensor.c
index 549622e275be..78d2f861dfac 100644
--- a/mlir/test/CAPI/sparse_tensor.c
+++ b/mlir/test/CAPI/sparse_tensor.c
@@ -43,7 +43,7 @@ static int testRoundtripEncoding(MlirContext ctx) {
   // CHECK: level_type: 2
   int numLevelTypes = mlirSparseTensorEncodingGetNumDimLevelTypes(originalAttr);
   enum MlirSparseTensorDimLevelType *levelTypes =
-      alloca(sizeof(enum MlirSparseTensorDimLevelType) * numLevelTypes);
+      malloc(sizeof(enum MlirSparseTensorDimLevelType) * numLevelTypes);
   for (int i = 0; i < numLevelTypes; ++i) {
     levelTypes[i] =
         mlirSparseTensorEncodingAttrGetDimLevelType(originalAttr, i);
@@ -64,6 +64,8 @@ static int testRoundtripEncoding(MlirContext ctx) {
   mlirAttributeDump(newAttr); // For debugging filecheck output.
   // CHECK: equal: 1
   fprintf(stderr, "equal: %d\n", mlirAttributeEqual(originalAttr, newAttr));
+
+  free(levelTypes);
   return 0;
 }
 


        


More information about the Mlir-commits mailing list