[all-commits] [llvm/llvm-project] 65f078: [ubsan] Omit return value check when return block ...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Thu Feb 6 10:24:32 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 65f0785fff0e45f8cd1b9e90328597197beef899
      https://github.com/llvm/llvm-project/commit/65f0785fff0e45f8cd1b9e90328597197beef899
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-02-06 (Thu, 06 Feb 2020)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    A clang/test/CodeGenObjC/ubsan-nullability-return-unreachable.m

  Log Message:
  -----------
  [ubsan] Omit return value check when return block is unreachable

If the return block is unreachable, clang removes it in
CodeGenFunction::FinishFunction(). This removal can leave dangling
references to values defined in the return block if the return block has
successors, which it /would/ if UBSan's return value check is emitted.

In this case, as the UBSan check wouldn't be reachable, it's better to
simply not emit it.

rdar://59196131




More information about the All-commits mailing list