[all-commits] [llvm/llvm-project] 9e8012: [MLIR] Fix crash in alias printer when encounterin...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Mar 26 03:58:05 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e8012cd1cca9b05502bc7aba5cbeead9de83707
      https://github.com/llvm/llvm-project/commit/9e8012cd1cca9b05502bc7aba5cbeead9de83707
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-03-26 (Thu, 26 Mar 2026)

  Changed paths:
    M mlir/lib/IR/AsmPrinter.cpp
    A mlir/test/IR/print-unsafe-null-operand.mlir

  Log Message:
  -----------
  [MLIR] Fix crash in alias printer when encountering null operands (#188581)

When the IR contains operations with null operand values, the
DummyAliasOperationPrinter used during alias collection crashed when
iterating over operand types via op->getOperandTypes(), because
ValueTypeIterator::mapElement calls value.getType() on each operand,
which dereferences null for a null Value.

Fix the crash by:
1. Iterating over operand values directly in printGenericOp, skipping
any null operands.
2. Adding a null-type guard in printType so that null types are silently
skipped.
3. Adding a null-type guard at the top of printAndVisitNestedAliasesImpl
to avoid crashing when visiting sub-elements of a null type.

The test requires using --mlir-very-unsafe-disable-verifier-on-parsing
to construct the invalid IR.

Fixes #182747

Assisted-by: Claude Code



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list