Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AV from DxBreak adding branch to null location (unreachable) #4446

Merged
merged 1 commit into from
May 12, 2022

Conversation

tex3d
Copy link
Contributor

@tex3d tex3d commented May 10, 2022

CodeGen for unreachable break would normally skip generation, but DxBreak
mechanism would insert conditional branch still. Unreachable location
means the builder has no insertion point. This led to null preds for
blocks, and an AV in SimplifyCFG.

Checking CFG.HaveInsertPoint() is the mechanism used elsewhere to skip
CodeGen in unreachable locations, so this is added to EmitHLSLCondBreak.

Fixes #4422

CodeGen for unreachable break would normally skip generation, but DxBreak
mechanism would insert conditional branch still.  Unreachable location
means the builder has no insertion point.  This led to null preds for
blocks, and an AV in SimplifyCFG.

Checking CFG.HaveInsertPoint() is the mechanism used elsewhere to skip
CodeGen in unreachable locations, so this is added to EmitHLSLCondBreak.
@tex3d tex3d requested a review from pow2clk May 10, 2022 17:28
@AppVeyorBot
Copy link

Copy link
Member

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This correctly duplicates the behavior of the original EmitBreakThroughCleanup function. Should have copied it better originally 😖

@tex3d tex3d merged commit 733740f into microsoft:master May 12, 2022
@tex3d tex3d deleted the fix-unreachable-break-av branch May 13, 2022 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants