Skip to content

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 2, 2025

Description:

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.

Scope/Impact: Any user code which happens to have a method called onReturn or decodeNextArgument and similar ones and DOES NOT import the Distributed module may crash during build "Archive" step.

Risk: Low, literarily returning false if a type is not available which is the correct thing to do.

Testing: Verified using reproducer project
Reviewed by:

Original PR: #80459
Radar: rdar://148327936

…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 requested a review from a team as a code owner April 2, 2025 10:28
@ktoso
Copy link
Contributor Author

ktoso commented Apr 2, 2025

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Apr 3, 2025

@swift-ci please smoke test

@ktoso ktoso changed the title 🍒[6.1][Distributed] Harden detecting adhoc req methods, don't crash when missing protocol decls 🍒[6.1][Distributed] Dont crash on specificly names methods which triggered Distributed checks Apr 3, 2025
@ktoso
Copy link
Contributor Author

ktoso commented Apr 3, 2025

@swift-ci please test Linux

@ktoso
Copy link
Contributor Author

ktoso commented Apr 3, 2025

@swift-ci please test macOS

@ktoso ktoso merged commit 7bf543c into swiftlang:release/6.1 Apr 10, 2025
5 checks passed
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