Skip to content

[Distributed] thread-safety also for parameter type metadata #81123

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

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 26, 2025

We had fixed this bug in #79381 but missed to realize the same problem existed for parameters as well.

This corrects the swift_func_getParameterTypeInfo impl, and also removes the entire "unsafe" method, we no longer use it anywhere.

Resolves rdar://146679254

@ktoso ktoso requested review from mikeash and al45tair as code owners April 26, 2025 12:28
@ktoso
Copy link
Contributor Author

ktoso commented Apr 26, 2025

@swift-ci please smoke test

We had fixed this bug in swiftlang#79381
but missed to realize the same problem existed for parameters as well.

This corrects the swift_func_getParameterTypeInfo impl, and also removes
the entire "unsafe" method, we no longer use it anywhere.

Resolves rdar://146679254
@ktoso ktoso force-pushed the wip-correct-metadata-handling-distributed branch from e350e74 to 284c060 Compare April 26, 2025 12:30
@@ -2907,25 +2907,6 @@ static NodePointer getParameterList(NodePointer funcType) {
return parameterContainer;
}

static const Metadata *decodeType(TypeDecoder<DecodedMetadataBuilder> &decoder,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completely removing this method.

@@ -3009,8 +2990,21 @@ swift_func_getParameterTypeInfo(

SubstGenericParametersFromMetadata substFn(genericEnv, genericArguments);

DecodedMetadataBuilder builder(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no other distributed impl funcs use this, so I'm hoping we're good.

The only other thing swift_func_getParameterCount does not seem like it has any of these problems.

@ktoso
Copy link
Contributor Author

ktoso commented Apr 26, 2025

@swift-ci please smoke test

@ktoso ktoso enabled auto-merge April 26, 2025 14:04
@ktoso ktoso merged commit ccecacc into swiftlang:main Apr 26, 2025
3 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.

2 participants