This is an archive of the discontinued LLVM Phabricator instance.

[mlir][memref] fix overflow in realloc
ClosedPublic

Authored by Peiming on Sep 22 2022, 6:54 PM.

Diff Detail

Event Timeline

Peiming created this revision.Sep 22 2022, 6:54 PM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Sep 22 2022, 6:54 PM
Peiming added inline comments.Sep 22 2022, 6:59 PM
mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
195

Note that the src memref and dst memref are guarantee to have the same element type by the verifier already. so it is safe here to reuse the size computed from dst memref.

aartbik accepted this revision.Sep 22 2022, 8:01 PM
aartbik added inline comments.
mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
195

Perhaps add that in a comment in the code too.

This revision is now accepted and ready to land.Sep 22 2022, 8:01 PM
Peiming updated this revision to Diff 462383.Sep 22 2022, 8:05 PM

address comments.

Peiming marked an inline comment as done.Sep 22 2022, 8:05 PM
This revision was automatically updated to reflect the committed changes.