[all-commits] [llvm/llvm-project] 75790d: [RemoveDIs] Fix nullptr dereference in getFirstNon...

Daniel Sanders via All-commits all-commits at lists.llvm.org
Mon Mar 11 16:05:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 75790dd2d0cff5b0c3e543e256f6c8f0fb5d0689
      https://github.com/llvm/llvm-project/commit/75790dd2d0cff5b0c3e543e256f6c8f0fb5d0689
  Author: Daniel Sanders <daniel_l_sanders at apple.com>
  Date:   2024-03-11 (Mon, 11 Mar 2024)

  Changed paths:
    M llvm/lib/IR/BasicBlock.cpp

  Log Message:
  -----------
  [RemoveDIs] Fix nullptr dereference in getFirstNonPHIIt() (#84595)

getFirstNonPHI() returns nullptr for blocks that lack a non-phi
(including a terminator) but getFirstNonPHIIt() may dereference its
result unconditionally. Return end() instead.

This came up for us downstream while correcting our getFirstNonPHI()
calls that intended to return the position after the phi's but before
the debug info to getFirstNonPHIIt(). The pass in question is populating
new BB's and hasn't added terminators yet.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list