mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Distributed] Don't drop dist get accessors from witness tables.
This actually manifested as an pointer auth crash, but the real reason being is that we messed up the order of elements in the witness table. If we'd skip the accessor like this, the types we sign/auth with would no longer align and manifest in a crash. There is no real reason to skip this entry so we just bring it back, and avoid making this special in any way. This unlocks a few tests as well as corrects any distributed+protocol use where a requirement distributed var was _followed by_ other requirements. resolves rdar://125628060
This commit is contained in:
@@ -273,10 +273,11 @@ static Flags getMethodDescriptorFlags(ValueDecl *fn) {
|
|||||||
return {Flags::Kind::ModifyCoroutine, false};
|
return {Flags::Kind::ModifyCoroutine, false};
|
||||||
case AccessorKind::Modify2:
|
case AccessorKind::Modify2:
|
||||||
return {Flags::Kind::ModifyCoroutine, true};
|
return {Flags::Kind::ModifyCoroutine, true};
|
||||||
|
case AccessorKind::DistributedGet:
|
||||||
|
return {Flags::Kind::Getter, false};
|
||||||
#define OPAQUE_ACCESSOR(ID, KEYWORD)
|
#define OPAQUE_ACCESSOR(ID, KEYWORD)
|
||||||
#define ACCESSOR(ID) \
|
#define ACCESSOR(ID) \
|
||||||
case AccessorKind::ID:
|
case AccessorKind::ID:
|
||||||
case AccessorKind::DistributedGet:
|
|
||||||
#include "swift/AST/AccessorKinds.def"
|
#include "swift/AST/AccessorKinds.def"
|
||||||
llvm_unreachable("these accessors never appear in protocols or v-tables");
|
llvm_unreachable("these accessors never appear in protocols or v-tables");
|
||||||
}
|
}
|
||||||
@@ -1070,13 +1071,6 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto &entry : pi.getWitnessEntries()) {
|
for (auto &entry : pi.getWitnessEntries()) {
|
||||||
if (entry.isFunction() &&
|
|
||||||
entry.getFunction().getDecl()->isDistributedGetAccessor()) {
|
|
||||||
// We avoid emitting _distributed_get accessors, as they cannot be
|
|
||||||
// referred to anyway
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Resilient) {
|
if (Resilient) {
|
||||||
if (entry.isFunction()) {
|
if (entry.isFunction()) {
|
||||||
// Define the method descriptor.
|
// Define the method descriptor.
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
// rdar://90373022
|
// rdar://90373022
|
||||||
// UNSUPPORTED: OS=watchos
|
// UNSUPPORTED: OS=watchos
|
||||||
|
|
||||||
// rdar://125628060
|
|
||||||
// UNSUPPORTED: CPU=arm64e
|
|
||||||
|
|
||||||
import Distributed
|
import Distributed
|
||||||
|
|
||||||
@Resolvable
|
@Resolvable
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
// rdar://90373022
|
// rdar://90373022
|
||||||
// UNSUPPORTED: OS=watchos
|
// UNSUPPORTED: OS=watchos
|
||||||
|
|
||||||
// rdar://125628060
|
|
||||||
// UNSUPPORTED: CPU=arm64e
|
|
||||||
|
|
||||||
import Distributed
|
import Distributed
|
||||||
|
|
||||||
@Resolvable
|
@Resolvable
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
// rdar://90373022
|
// rdar://90373022
|
||||||
// UNSUPPORTED: OS=watchos
|
// UNSUPPORTED: OS=watchos
|
||||||
|
|
||||||
// rdar://125628060
|
|
||||||
// UNSUPPORTED: CPU=arm64e
|
|
||||||
|
|
||||||
import Distributed
|
import Distributed
|
||||||
|
|
||||||
@available(SwiftStdlib 6.0, *)
|
@available(SwiftStdlib 6.0, *)
|
||||||
|
|||||||
Reference in New Issue
Block a user