-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ClosureLifetimeFixup: Handle undef partial_apply arguments gracefully #28805
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
ClosureLifetimeFixup: Handle undef partial_apply arguments gracefully #28805
Conversation
We have to handle undef partial_apply arguments to handle the following source gracefully during the diagnosis pipeline. ``` class TestUndefined { private var stringList: [String]! func dontCrash(strings: [String]) { assert(stringList.allSatisfy({ $0 == stringList.first!})) let stringList = strings.filter({ $0 == "a" }) } } ``` rdar://57893008
@swift-ci Please 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.
A question and a thought.
- Shouldn't a destroy_value on undef or a destroy_addr on undef just be a no-op? What was the specific crash?
- I imagine this is a greater problem in the optimizer. I bet you that if we had a pass that changed random values to be undef, we would catch a ton of bugs. Not saying you need to do that here though. For instance, what about mandatory inlining.
Beyond that in the local the code looks ok locally. Can I get my question above answered, then I LGTM?
We call arg->getFunction() is null. |
…ApplyCapturedArg to handle undef captures
@swift-ci Please test |
Build failed |
Build failed |
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.
LGTM!
We have to handle undef partial_apply arguments to handle the following
source gracefully during the diagnosis pipeline.
rdar://57893008