[all-commits] [llvm/llvm-project] 12ccc5: [mlir] Change the order of members in MLIRContext ...

Laszlo Kindrat via All-commits all-commits at lists.llvm.org
Thu May 25 09:18:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 12ccc59594916caf8a833f749cc820dde961d83d
      https://github.com/llvm/llvm-project/commit/12ccc59594916caf8a833f749cc820dde961d83d
  Author: Laszlo Kindrat <laszlo at modular.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M mlir/lib/IR/MLIRContext.cpp

  Log Message:
  -----------
  [mlir] Change the order of members in MLIRContext to ensure dialects are destroyed first

Currently, the dialects precede the registered operations in the context object, which means that the latter is destroyed first. At the same time, Operation::~Operation dereferences the registered operation when destroying properties, which can cause use-after-free (e.g. if a dialect owns an op). This patch fixes that by changing the order of the members so that dialects come after registered operations.

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




More information about the All-commits mailing list