[all-commits] [llvm/llvm-project] 5cac85: [mlir] Check for type conversion success in std->l...

ftynse via All-commits all-commits at lists.llvm.org
Mon Sep 14 04:17:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cac85c931d95f3c94f79837a3bf406eb68edaeb
      https://github.com/llvm/llvm-project/commit/5cac85c931d95f3c94f79837a3bf406eb68edaeb
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-09-14 (Mon, 14 Sep 2020)

  Changed paths:
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/test/Conversion/StandardToLLVM/invalid.mlir

  Log Message:
  -----------
  [mlir] Check for type conversion success in std->llvm function conversion

Type converter may fail and return nullptr on unconvertible types. The function
conversion did not include a check and was attempting to use a nullptr type to
construct an LLVM function, leading to a crash. Add a check and return early.
The rest of the call stack propagates errors properly.

Fixes PR47403.

Reviewed By: mehdi_amini

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




More information about the All-commits mailing list