[Mlir-commits] [mlir] 00040d7 - [mlir][sparse] fix broken asan test
Aart Bik
llvmlistbot at llvm.org
Thu Oct 28 20:54:15 PDT 2021
Author: Aart Bik
Date: 2021-10-28T20:53:58-07:00
New Revision: 00040d7349603dc3fd5ba29364ddc83ebee764b0
URL: https://github.com/llvm/llvm-project/commit/00040d7349603dc3fd5ba29364ddc83ebee764b0
DIFF: https://github.com/llvm/llvm-project/commit/00040d7349603dc3fd5ba29364ddc83ebee764b0.diff
LOG: [mlir][sparse] fix broken asan test
TBR : delete was dropped from previous approved revision (https://reviews.llvm.org/D110790), breaking asan
Differential Revision: https://reviews.llvm.org/D112779
Added:
Modified:
mlir/lib/ExecutionEngine/SparseUtils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/SparseUtils.cpp b/mlir/lib/ExecutionEngine/SparseUtils.cpp
index 0b82378c2db2..d193e804bac2 100644
--- a/mlir/lib/ExecutionEngine/SparseUtils.cpp
+++ b/mlir/lib/ExecutionEngine/SparseUtils.cpp
@@ -635,16 +635,18 @@ enum Action : uint32_t {
}
#define IMPL_GETNEXT(NAME, V) \
- bool _mlir_ciface_##NAME(void *ptr, StridedMemRefType<uint64_t, 1> *iref, \
+ bool _mlir_ciface_##NAME(void *tensor, StridedMemRefType<uint64_t, 1> *iref, \
StridedMemRefType<V, 0> *vref) { \
assert(iref->strides[0] == 1); \
uint64_t *indx = iref->data + iref->offset; \
V *value = vref->data + vref->offset; \
const uint64_t isize = iref->sizes[0]; \
- auto iter = static_cast<SparseTensorCOO<V> *>(ptr); \
+ auto iter = static_cast<SparseTensorCOO<V> *>(tensor); \
const Element<V> *elem = iter->getNext(); \
- if (elem == nullptr) \
+ if (elem == nullptr) { \
+ delete iter; \
return false; \
+ } \
for (uint64_t r = 0; r < isize; r++) \
indx[r] = elem->indices[r]; \
*value = elem->value; \
More information about the Mlir-commits
mailing list