C++ interop pointer double freed when passing std::vector<float> to Swift initializer #69380
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
c++ interop
Feature: Interoperability with C++
swift 5.10
triage needed
This issue needs more specific labels
Uh oh!
There was an error while loading. Please reload this page.
Description
If I define a Swift class that accepts a std::vector<float> as the argument in its initializer, I can successfully create an instance of that class from C++, but when that object is destructed I get the following error: *** error for object 0x600001298050: pointer being freed was not allocated.
Steps to reproduce
The following steps reproduce the crash for me using XCode 15.0.1 (15A507) on an M1 Max MBP running Sonoma 14.1:
auto obj = TestCommand::TestClass::init(vals);
toauto obj = TestCommand::TestClass::create(vals);
avoids the error.Environment
Swift compiler version info: swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Xcode version info: Xcode 15.0.1 Build version 15A507
Deployment target: macOS Sonoma 14.1 (23B73)
The text was updated successfully, but these errors were encountered: