From 5ffa68f8b2b05213528e2f2e5af0f22252f0a2b1 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 16 Mar 2023 14:47:18 -0700 Subject: [PATCH] IRGen: correct field counting for distributed actors Correct the counting between `forEachField` and `getNumFields` to correctly enumerate the synthesized fields. We would previously fail to count the non-root default actor resulting in a mismatch on the stored field counts. Fortunately, we were able to catch this by means of an assertion in the compiler which triggered on Windows. Special thanks to @etcwilde for the help in tracking this down! rdar://106822386 --- lib/IRGen/StructLayout.cpp | 2 +- .../Runtime/distributed_actor_assume_executor.swift | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/IRGen/StructLayout.cpp b/lib/IRGen/StructLayout.cpp index eeb8096bf9662..eb2230fb022c9 100644 --- a/lib/IRGen/StructLayout.cpp +++ b/lib/IRGen/StructLayout.cpp @@ -446,7 +446,7 @@ unsigned irgen::getNumFields(const NominalTypeDecl *target) { if (auto cls = dyn_cast(target)) { if (cls->isRootDefaultActor()) { numFields++; - } else if (cls->isRootDefaultActor()) { + } else if (cls->isNonDefaultExplicitDistributedActor()) { numFields++; } } diff --git a/test/Distributed/Runtime/distributed_actor_assume_executor.swift b/test/Distributed/Runtime/distributed_actor_assume_executor.swift index 961857e9e2f46..66d725474554b 100644 --- a/test/Distributed/Runtime/distributed_actor_assume_executor.swift +++ b/test/Distributed/Runtime/distributed_actor_assume_executor.swift @@ -14,9 +14,6 @@ // UNSUPPORTED: use_os_stdlib // UNSUPPORTED: freestanding -// rdar://106822386 -// REQUIRES: rdar106822386 - import StdlibUnittest import Distributed import FakeDistributedActorSystems