[Mlir-commits] [mlir] [MLIR] Fix crash in alias printer when encountering null operands (PR #188581)

Mehdi Amini llvmlistbot at llvm.org
Thu Mar 26 03:39:01 PDT 2026


================
@@ -752,9 +752,12 @@ class DummyAliasOperationPrinter : private OpAsmPrinter {
                     /*printBlockTerminators=*/true);
     }
 
-    // Visit all the types used in the operation.
-    for (Type type : op->getOperandTypes())
-      printType(type);
+    // Visit all the types used in the operation. Null operands/types can
+    // occur when operating on invalid IR (e.g., with
+    // --mlir-very-unsafe-disable-verifier-on-parsing), so guard against them.
+    for (Value operand : op->getOperands())
+      if (operand && operand.getType())
+        printType(operand.getType());
----------------
joker-eph wrote:

Yes!

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


More information about the Mlir-commits mailing list