What could cause _swift_release_dealloc to segfault?

i’ve gotten this down to a minimal reproducer, which i filed on GitHub.

it seems to affect defer statements that capture bindings that use the consuming ownership specifier. because the miscompile affects ref counting, the crashes can occur very far away from where the ref count actually diverged, which made it challenging to isolate the actual cause of the crash.

3 Likes