[Mlir-commits] [mlir] [mlir][linalg] Fix crashes in parser on linalg ops without operands (PR #97944)

Matthias Springer llvmlistbot at llvm.org
Sun Jul 7 04:12:35 PDT 2024


================
@@ -1356,8 +1356,10 @@ ParseResult MapOp::parse(OpAsmParser &parser, OperationState &result) {
     return failure();
 
   if (payloadOpName.has_value()) {
-    addBodyWithPayloadOp(parser, result, payloadOpName.value(), payloadOpAttrs,
-                         ArrayRef(result.operands).drop_back());
+    if (!result.operands.empty())
----------------
matthias-springer wrote:

Alternatively: I think adding an empty region in the `else` branch should give a better error message.

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


More information about the Mlir-commits mailing list