[all-commits] [llvm/llvm-project] cedeb3: [mlir] Support null interface to base conversion (...

Markus Böck via All-commits all-commits at lists.llvm.org
Mon Sep 11 23:43:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cedeb31e6d08b1e1e134478b36dd7ed1ef6221a0
      https://github.com/llvm/llvm-project/commit/cedeb31e6d08b1e1e134478b36dd7ed1ef6221a0
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
    M mlir/unittests/IR/InterfaceTest.cpp

  Log Message:
  -----------
  [mlir] Support null interface to base conversion (#65988)

The current implicit conversion operator from an interface to a "base
interface" of the interface unconditionally calls `this->getImpl()`
which leads to accessing a null pointer if the interface instance is a
null instance.

This PR changes the ODS generated interface instance to explicitly check
and then return a null interface instance if the `this` instance is a
null instance.




More information about the All-commits mailing list