Skip to content

[Distributed] Harden detecting adhoc req methods #80459

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

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 2, 2025

Don't crash when missing protocol decls.

This issue manifested in crashing when in Xcode one would do the Archive workflow, and we would be missing the Distributed module types and proceed to run into a nullpointer when faced with code like this:

public class TestViewModel {
    public init() {}
    public func onReturn() {
       print("on return executed!")
    }
}

where the name matched one of the ad hoc requirements, but we'd get null for the protocol lookup since this does not import the distributed module.

resolves rdar://148327936

*

I could not figure how to replicate the "Archive" behavior even though copying the exact command Xcode was doing hmm...

…ssing protocol decls

This issue manifested in crashing when in Xcode one would do the Archive
workflow, and we would be missing the Distributed module types and
proceed to run into a nullpointer when faced with code like this:

```
public class TestViewModel {
    public init() {}

    public func onReturn() {
        print("on return executed!")
    }
}
```

where the name matched one of the ad hoc requirements, but we'd get null
for the protocol lookup since this does not import the distributed
module.

resolves rdar://148327936
@ktoso ktoso force-pushed the wip-dontcrash-on-missing-type-when-detecting-distributed-adhoc-reqs branch from f3ea823 to 6ca5ace Compare April 2, 2025 09:45
@ktoso ktoso changed the title [Distributed] Harden detecting adhoc req methods, don't crash when mi… [Distributed] Harden detecting adhoc req methods Apr 2, 2025
@ktoso
Copy link
Contributor Author

ktoso commented Apr 2, 2025

@swift-ci please smoke test

@ktoso ktoso merged commit d15f6c7 into swiftlang:main Apr 2, 2025
3 checks passed
@ktoso ktoso deleted the wip-dontcrash-on-missing-type-when-detecting-distributed-adhoc-reqs branch April 3, 2025 01:26
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

LGTM!

@ktoso
Copy link
Contributor Author

ktoso commented Apr 3, 2025

Thank you for reviewing :)

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