[all-commits] [llvm/llvm-project] 3ebb3e: [mlir][bytecode] Fix crash when reading DenseIntOr...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Mar 5 04:18:08 PST 2026


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

  Changed paths:
    M mlir/lib/IR/BuiltinDialectBytecode.cpp
    A mlir/test/Bytecode/invalid/invalid-dense-elem-type-interface.mlir

  Log Message:
  -----------
  [mlir][bytecode] Fix crash when reading DenseIntOrFPElementsAttr with unsupported element type (#184773)

When a bytecode type callback substitutes a type that does not implement
DenseElementTypeInterface (e.g., \!test.i32 replacing i32), the bytecode
reader attempted to reconstruct a DenseIntOrFPElementsAttr with that
type. This unconditionally called getDenseElementBitWidth() which hit an
llvm_unreachable on unsupported types.

Fix this by validating the element type implements
DenseElementTypeInterface in readDenseIntOrFPElementsAttr before
proceeding. If the check fails, a proper diagnostic is emitted and
reading fails gracefully instead of crashing.

Fixes #128317



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