================
@@ -424,6 +424,10 @@ LogicalResult cir::FuncOp::verifyType() {
   if (!isa<cir::FuncType>(type))
     return emitOpError("requires '" + getFunctionTypeAttrName().str() +
                        "' attribute of function type");
+  if (auto rt = type.getReturnTypes();
----------------
dkolsen-pgi wrote:

`rt.size() > 1` is an impossible situation.  `FuncType` stores only one 
`mlir::Type` return type.  There is no possible code path where 
`FuncType::getReturnTypes` could create an `llvm::ArrayRef<mlir::Type>` with 
more than one member, even if `FuncType`'s invariants were broken.

But adding a check for that here doesn't hurt.  I'll do that.

https://github.com/llvm/llvm-project/pull/128787
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to