mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: Don't fail out of loadNamedMembers()
This cleanup exposed a problem with deserialization recovery and property wrappers. If deserializing a property backed by a wrapper failed, the lazy member lookup would fail, but subsequently a loadAllMembers() call would still load the property. This behavior is actually incorrect, because silently dropping a stored property of a @frozen struct can result in miscompiles. I've filed rdar://59403542 and rdar://59403617 to track fixing this. In the meantime, I've tweaked the logic a bit to preserve the old behavior.
This commit is contained in:
@@ -2399,7 +2399,7 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
|
||||
fatalIfUnexpected(DeclMemberTablesCursor.advance());
|
||||
if (entry.Kind != llvm::BitstreamEntry::Record) {
|
||||
fatal();
|
||||
return None;
|
||||
return results;
|
||||
}
|
||||
SmallVector<uint64_t, 64> scratch;
|
||||
StringRef blobData;
|
||||
@@ -2424,10 +2424,6 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(mem.takeError());
|
||||
consumeError(mem.takeError());
|
||||
|
||||
// Treat this as a cache-miss to the caller and let them attempt
|
||||
// to refill through the normal loadAllMembers() path.
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user