-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] Don't crash in thunk generation when missing SR conformance #69501
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
[Distributed] Don't crash in thunk generation when missing SR conformance #69501
Conversation
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test macOS Failure was unrelated: fatal error: module map file '/home/build-user/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/release/llbuildBasic.build/module.modulemap' not found ci.swift.org/job/swift-PR-macos-smoke-test/9867/console |
@swift-ci please smoke test macOS |
@swift-ci please smoke test |
This is looking better now, thanks @slavapestov The only case we've regressed on now is:
since the |
de8ed4d
to
5595dd3
Compare
@swift-ci please smoke test |
5595dd3
to
75e2eba
Compare
@swift-ci please smoke test |
75e2eba
to
0f5e564
Compare
@swift-ci please smoke test |
for (auto requirement: signature.getRequirements()) { | ||
if (requirement.getFirstType()->isEqual(SerReqAssocType) && | ||
requirement.getKind() == RequirementKind::Conformance) { | ||
if (auto nominal = requirement.getSecondType()->getAnyNominal()) { |
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.
The RHS of a conformance requirement is always a protocol. Call requirement.getProtocolDecl() to get it
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.
Nice, thank you!
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.
done in #69874
Problem: We would properly diagnose the missing conformance; but the compiler would still try to emit a thunk for the errored
func
. Tests which only-typecheck -verify
would not catch this issue because it is after type checking.The fix: This prevents distributed thunks from being generated when the func they are based on already has errors -- otherwise we can run into missing types and null pointers as we try to generate the thunk.
a
Radar: rdar://116261701
And found a follow up we should do: rdar://117677422