Skip to content

Fix a logic error in eraseUseOfValue. #2077

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

Merged
merged 1 commit into from
Apr 14, 2016
Merged

Fix a logic error in eraseUseOfValue. #2077

merged 1 commit into from
Apr 14, 2016

Conversation

trentxintong
Copy link
Contributor

No description provided.

@@ -208,6 +208,10 @@ void swift::eraseUsesOfValue(SILValue V) {
auto *User = UI->getUser();
UI++;

// User could be removed at this point.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the right fix? If the User is removed are we guaranteed to have it be nulled out?

Why not use a SmallPointerSet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One possibility is to collect all the direct and transitive users of the SILValue and remove them one by one. But that may leave us with some dead, but not removed instructions.

@trentxintong
Copy link
Contributor Author

@swift-ci Please test Linux

@trentxintong
Copy link
Contributor Author

@swift-ci Please test

I failed to create a test case. And we hav existing tests in FSO that will
exercise this.

rdar://25559780
@trentxintong
Copy link
Contributor Author

@swift-ci Please test

@trentxintong trentxintong merged commit 3abe479 into swiftlang:master Apr 14, 2016
MaxDesiatov pushed a commit that referenced this pull request Apr 19, 2021
[pull] swiftwasm from main
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.

2 participants