Skip to content

Commit 362783c

Browse files
committed
[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
1 parent 916e96d commit 362783c

File tree

4 files changed

+2
-17
lines changed

4 files changed

+2
-17
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,11 @@ static Flags getMethodDescriptorFlags(ValueDecl *fn) {
273273
return {Flags::Kind::ModifyCoroutine, false};
274274
case AccessorKind::Modify2:
275275
return {Flags::Kind::ModifyCoroutine, true};
276+
case AccessorKind::DistributedGet:
277+
return {Flags::Kind::Getter, false};
276278
#define OPAQUE_ACCESSOR(ID, KEYWORD)
277279
#define ACCESSOR(ID) \
278280
case AccessorKind::ID:
279-
case AccessorKind::DistributedGet:
280281
#include "swift/AST/AccessorKinds.def"
281282
llvm_unreachable("these accessors never appear in protocols or v-tables");
282283
}
@@ -1070,13 +1071,6 @@ namespace {
10701071
}
10711072

10721073
for (auto &entry : pi.getWitnessEntries()) {
1073-
if (entry.isFunction() &&
1074-
entry.getFunction().getDecl()->isDistributedGetAccessor()) {
1075-
// We avoid emitting _distributed_get accessors, as they cannot be
1076-
// referred to anyway
1077-
continue;
1078-
}
1079-
10801074
if (Resilient) {
10811075
if (entry.isFunction()) {
10821076
// Define the method descriptor.

test/Distributed/Runtime/distributed_actor_localSystem_distributedProtocol.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// rdar://90373022
1515
// UNSUPPORTED: OS=watchos
1616

17-
// rdar://125628060
18-
// UNSUPPORTED: CPU=arm64e
19-
2017
import Distributed
2118

2219
@Resolvable

test/Distributed/Runtime/distributed_actor_localSystem_distributedProtocol_variable.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// rdar://90373022
1515
// UNSUPPORTED: OS=watchos
1616

17-
// rdar://125628060
18-
// UNSUPPORTED: CPU=arm64e
19-
2017
import Distributed
2118

2219
@Resolvable

test/Distributed/Runtime/distributed_actor_localSystem_manual_conformance.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// rdar://90373022
1515
// UNSUPPORTED: OS=watchos
1616

17-
// rdar://125628060
18-
// UNSUPPORTED: CPU=arm64e
19-
2017
import Distributed
2118

2219
@available(SwiftStdlib 6.0, *)

0 commit comments

Comments
 (0)