Skip to content

Commit 586ce6a

Browse files
committed
[MLIR][NFC] Fix a memset in MemRefUtils.h
found by PVS-Studio - https://pvs-studio.com/en/blog/posts/cpp/1003/, N10. memset function expects to take int as the second actual argument, but receives a pointer. Here, the first and the second argument of the function are mixed up. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D142310
1 parent bee8860 commit 586ce6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/ExecutionEngine/MemRefUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class OwningMemRef {
191191
freeFunc = other.freeFunc;
192192
descriptor = other.descriptor;
193193
other.freeFunc = nullptr;
194-
memset(0, &other.descriptor, sizeof(other.descriptor));
194+
memset(&other.descriptor, 0, sizeof(other.descriptor));
195195
}
196196
OwningMemRef(OwningMemRef &&other) { *this = std::move(other); }
197197

0 commit comments

Comments
 (0)