mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Targeted fix for LLDB REPL issue
LLDB changes accessiblity of declarations after type checking, which is not a good idea because it is likely to break invariants. Indeed, the validateFixedLayoutAttribute() / hasFixedLayout() logic was not prepared for this possibility. This is a targeted fix to address the immediate breakage. A better fix would be to change LLDB, and also to change Sema to store the global -enable-resilience flag state in a bit in the serialized module, instead of sticking it on every declaration. Fixes <rdar://problem/23545959>.
This commit is contained in:
@@ -1857,6 +1857,10 @@ bool NominalTypeDecl::hasFixedLayout() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Objective-C enums always have a fixed layout.
|
||||
if (isa<EnumDecl>(this) && isObjC())
|
||||
return true;
|
||||
|
||||
// Otherwise, access via indirect "resilient" interfaces.
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user