Skip to content

Commit 3b13f88

Browse files
committed
[mlir][sparse] fix unsigned comparison bug in assert
Reviewed By: bixia, wrengr Differential Revision: https://reviews.llvm.org/D126007
1 parent 9ece051 commit 3b13f88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/ExecutionEngine/SparseTensorUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ class SparseTensorEnumerator final : public SparseTensorEnumeratorBase<V> {
885885
const uint64_t pstop = static_cast<uint64_t>(pointers_d[parentPos + 1]);
886886
// Loop-invariant code for looking up the `d`-level coordinates/indices.
887887
const std::vector<I> &indices_d = src.indices[d];
888-
assert(pstop - 1 < indices_d.size() && "Index position is out of bounds");
888+
assert(pstop <= indices_d.size() && "Index position is out of bounds");
889889
uint64_t &cursor_reord_d = this->cursor[this->reord[d]];
890890
for (uint64_t pos = pstart; pos < pstop; pos++) {
891891
cursor_reord_d = static_cast<uint64_t>(indices_d[pos]);

0 commit comments

Comments
 (0)