Skip to content

Commit 30d5453

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 352f392 commit 30d5453

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
}
@@ -1069,13 +1070,6 @@ namespace {
10691070
}
10701071

10711072
for (auto &entry : pi.getWitnessEntries()) {
1072-
if (entry.isFunction() &&
1073-
entry.getFunction().getDecl()->isDistributedGetAccessor()) {
1074-
// We avoid emitting _distributed_get accessors, as they cannot be
1075-
// referred to anyway
1076-
continue;
1077-
}
1078-
10791073
if (Resilient) {
10801074
if (entry.isFunction()) {
10811075
// 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)