[compiler-rt] [llvm] [mlir] [clang] [flang] [clang-tools-extra] [mlir][memref] Detect negative `offset` or `size` for `subview` (PR #72059)

Rik Huijzer via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 03:12:45 PST 2023


================
@@ -2842,8 +2851,18 @@ static LogicalResult produceSubViewErrorMsg(SliceVerificationResult result,
   llvm_unreachable("unexpected subview verification result");
 }
 
-/// Verifier for SubViewOp.
 LogicalResult SubViewOp::verify() {
+  for (int64_t offset : getStaticOffsets()) {
----------------
rikhuijzer wrote:

Yes that makes a lot of sense IMO. I find it quite impressive from the MLIR developers that adding the check (e4e40f2) causes none of the tests to fail! Hopefully nobody downstream depends on this logic even though it shouldn't work anyway.

https://github.com/llvm/llvm-project/pull/72059


More information about the cfe-commits mailing list