Skip to content

Adding a CompactedCollection to an Array triggers EXC_BAD_ACCESS #209

Open
@davbeck

Description

@davbeck

When combining a CompactedCollection of objects with an array of objects, in release mode, code will crash with EXC_BAD_ACCESS.

Swift Algorithms version:
1.1.0 but I also saw this in 0.0.3

Swift version:
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0

Checklist

  • If possible, I've reproduced the issue using the main branch of this package
  • I've searched for existing GitHub issues

Steps to Reproduce

I've attached an iOS project that reproduces this. From the Xcode template, I've edited the scheme to run in Release mode. Here is the relevant code that triggers the crash:

final class Thing {}
let things = [Thing()].compacted() + [Thing()]
print("things", things)

Expected behavior

Not to crash

Actual behavior

EXC_BAD_ACCESS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions