[all-commits] [llvm/llvm-project] 60d719: [mlir] Check nullity of MixedContainerType and Typ...

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Tue Mar 8 10:19:16 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 60d719b462a136a75610bf1d1c9f4e043d394eea
      https://github.com/llvm/llvm-project/commit/60d719b462a136a75610bf1d1c9f4e043d394eea
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2022-03-08 (Tue, 08 Mar 2022)

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    M mlir/test/mlir-tblgen/op-attribute.td

  Log Message:
  -----------
  [mlir] Check nullity of MixedContainerType and TypedArrayAttrBase

    It's valid to create a TypedArrayAttr or MixedContainerType with
    nullptr, e.g.,
      std::vector<mlir::Attribute> attrs = {mlir::StringAttr()};
      builder.createArrayAttr(attrs);

    The predicate didn't check if it's a nullptr and it ended up a crash in
    the attribute static verifier. We always check if an attribute is null
    so it's better to align the check for these two container type attr.

Reviewed By: rdzhabarov

Differential Revision: https://reviews.llvm.org/D121178




More information about the All-commits mailing list