Skip to content

Fix serialize bug on detached / continuation mismatch#74

Open
wsmoses wants to merge 1 commit into
masterfrom
serbug
Open

Fix serialize bug on detached / continuation mismatch#74
wsmoses wants to merge 1 commit into
masterfrom
serbug

Conversation

@wsmoses

@wsmoses wsmoses commented Jul 23, 2018

Copy link
Copy Markdown
Owner

@wsmoses wsmoses requested a review from neboat July 23, 2018 17:31
Comment thread lib/Transforms/Utils/SimplifyCFG.cpp Outdated
return false;
if (auto DI = dyn_cast<DetachInst>(PredBB->getTerminator())) {
// check that we are the detached (and not continuation)
return DI->getDetached() == BB;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't want to return true here. You've made the actual simplification dead!

@wsmoses

wsmoses commented Jul 23, 2018

Copy link
Copy Markdown
Owner Author

Indeed, resolved.

return false;
if (auto DI = dyn_cast<DetachInst>(PredBB->getTerminator())) {
// check that we are the detached (and not continuation)
if(DI->getDetached() != BB) return false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For consistent code style, I'd prefer a space between the if and first (.

@neboat

neboat commented Jul 23, 2018

Copy link
Copy Markdown
Collaborator

Can we get a regression test for this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants