[all-commits] [llvm/llvm-project] a9a6e6: [CodeGen] Make sure the EH cleanup for block captu...

Erik Pilkington via All-commits all-commits at lists.llvm.org
Mon Aug 31 07:12:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a9a6e62ddff21c597b82f0f6d26bca6a1a473a6f
      https://github.com/llvm/llvm-project/commit/a9a6e62ddff21c597b82f0f6d26bca6a1a473a6f
  Author: Erik Pilkington <erik.pilkington at gmail.com>
  Date:   2020-08-31 (Mon, 31 Aug 2020)

  Changed paths:
    M clang/lib/CodeGen/CGDecl.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    A clang/test/CodeGenObjC/arc-blocks-exceptions.m

  Log Message:
  -----------
  [CodeGen] Make sure the EH cleanup for block captures is conditional when the block literal is in a conditional context

Previously, clang was crashing on the attached test because the EH cleanup for
the block capture was incorrectly emitted under the assumption that the
expression wasn't conditionally evaluated. This was because before 9a52de00260,
pushLifetimeExtendedDestroy was mainly used with C++ automatic lifetime
extension, where a conditionally evaluated expression wasn't possible. Now that
we're using this path for block captures, we need to handle this case.

rdar://66250047

Differential revision: https://reviews.llvm.org/D86854




More information about the All-commits mailing list