Commit Graph

8 Commits

Author SHA1 Message Date
Ben Barham
3afb498896 [Deserialization] Do not assert on a missing witness if allowing errors
When allowing errors we may have serialized a requirement without a
witness, do not assert when deserializing.

Resolves rdar://81884767
2021-08-13 17:15:21 +10:00
Ben Barham
69a5a3d3e8 [Serialization] Check for anchoring VarDecl when serializing PDB
An invalid PDB may have no anchoring VarDecl when allowing errors, make
sure not to crash in that case.
2021-08-06 17:55:02 +10:00
Ben Barham
462ce0584d [Serialization] Properly skip invalid destructors when allowing errors
7856f2d83d only partially skipped writing
out destructors when they were invalid, ie. it skipped writing the decl
itself but not the records common to all decls. This would cause any
records on the destructor to be applied on the next serialized decl.

Make sure to skip serializing anything to do with the destructor when
it's invalid and does not have a class context.
2021-08-06 13:45:32 +10:00
Ben Barham
1fea98cbad [Serialization] Allow conformances with no witness if allowing errors
Note that deserialization already handles this case when recovery is
enabled.
2021-06-02 11:45:29 +10:00
Ben Barham
6d038c86bc [Serialization] Skip deserializing invalid attributes if allowing errors
Most invalid attributes are skipped from serialization entirely, but
custom attributes don't have their invalid bit set - the particular
custom attribute (eg. a property wrapper) is requested when needed and
skipped if invalid. Those checks can't set the invalid bit since the
attribute could be a different custom attribute (eg. a result builder).
2021-06-02 11:45:29 +10:00
Ben Barham
c490f928cb [Serialization] Serialize unresolved types as errors if allowing errors 2021-06-02 11:45:29 +10:00
Ben Barham
073a5828a2 [Serialization] Skip verifying attributes when allowing errors
When allowing errors any attribute could be on any decl, so don't verify
whether an attribute can appear on a decl. Note that these attributes
aren't serialized anyway since they'll be set to invalid during
typechecking and hence skipped.
2021-06-02 11:44:53 +10:00
Ben Barham
7856f2d83d [Serialization] Skip serializing invalid destructors if allowing errors 2021-06-02 11:39:14 +10:00