SIL: fix serialization of the unchecked_ref_cast instruction

We didn't serialize the ownership kind, which resulted in a miscompile causing an over-release.

The unchecked_ref_cast is the only instruction for which we change the ownership in the optimizer, so that it doesn't match the operand's ownership. Therefore this fix is sufficient for now - we don't need to serialize the ownership of other instructions.
But this is really a design flaw of the `OwnershipForwardingMixin`. It should not allow to set the ownership to arbitrary values.

rdar://92696202
This commit is contained in:
Erik Eckstein
2022-05-06 14:27:59 +02:00
parent 54b9aff2f4
commit 26b03096c6
5 changed files with 36 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 688; // SILBoxType extensions
const uint16_t SWIFTMODULE_VERSION_MINOR = 689; // cast ownership serialization
/// A standard hash seed used for all string hashes in a serialized module.
///