Skip to content

Commit 639c19d

Browse files
authored
[NFC][mlir] make the assert consistent with the declared behavior (#143874)
1 parent 77834a4 commit 639c19d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/include/mlir/ExecutionEngine/MemRefUtils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ inline std::array<int64_t, N> makeStrides(ArrayRef<int64_t> shape) {
4848
std::array<int64_t, N> res;
4949
int64_t running = 1;
5050
for (int64_t idx = N - 1; idx >= 0; --idx) {
51-
assert(shape[idx] && "size must be non-negative for all shape dimensions");
51+
assert(shape[idx] >= 0 &&
52+
"size must be non-negative for all shape dimensions");
5253
res[idx] = running;
5354
running *= shape[idx];
5455
}

0 commit comments

Comments
 (0)