Unverified Commit 75790dd2 authored by Daniel Sanders's avatar Daniel Sanders Committed by GitHub
Browse files

[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.
parent d125d557
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment