[SR-8990] Miscompile (possible assertion failure) modifying nonmutating property on protocol #51493
Labels
access control
Feature → modifiers: Access control and access levels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
regression
swift 4.2
Attachment: Download
Additional Detail from JIRA
md5: cc1eadc6334f9f313216b81e73193004
Issue Description:
Users report their app is crashing due to a use-after-free when modifying a nonmutating property defined on a protocol extension. Test case project here:
iZettle/Flow#34 (comment)
They note that a snapshot compiler with asserts on hits an assertion failure:
iZettle/Flow#34 (comment)
The problem occurs when a property defined in a protocol or protocol extension with a nonmutating setter is mutated indirectly, as in:
The problem can be worked around by separating the `get` and `set` of the nonmutating property into their own statements:
The text was updated successfully, but these errors were encountered: