-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SILCombine: fix a miscompile in dead alloc_existential_box removal #24835
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
Conversation
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. Small quibble about making a comment clearer and also an ask for an interpreter test case if we have one.
// CHECK-NEXT: release_value [[T]] | ||
// CHECK-NEXT: tuple | ||
// CHECK-NEXT: return | ||
sil @insert_compensating_release_at_release_of_box : $@convention(method) (@in_guaranteed Array<Error>) -> () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question. Is there an interpreter test that you can make for this as well? Was there a reduced test case that you had?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I have one. I'll add it.
// is going away so we need to release the stored value. | ||
// Note that it's important that the release is inserted at the single | ||
// release of the box and not at the store, because a balancing retain could | ||
// be _after_ the store, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be a colon after this. Also can you make Note in all capital letters? Something like this:
Release the value that was stored into the existential box. The box
is going away, so we need to release the stored value.
NOTE: It is important that the release is inserted at the single release of the box and /not/ at the store since a balancing retain could be after the store, e.g.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I'll change it
The miscompile results in a use-after-free crash. rdar://problem/50759056
@swift-ci smoke test and merge |
1 similar comment
@swift-ci smoke test and merge |
The miscompile results in a use-after-free crash.
rdar://problem/50759056