Skip to content

Commit f47d563

Browse files
committed
Replace mismatched delete with swift_cxx_deleteObject
The `allocatedEntry` is allocated with `swift_cxx_newObject` so it should be deallocated with the `swift_cxx_deleteObject`.
1 parent 4a68116 commit f47d563

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ namespace {
10611061

10621062
// Otherwise, use the new entry and destroy the one we allocated.
10631063
assert(existingEntry && "spurious failure of strong compare-exchange?");
1064-
delete allocatedEntry;
1064+
swift_cxx_deleteObject(allocatedEntry);
10651065
}
10661066

10671067
return { static_cast<SingletonMetadataCacheEntry*>(existingEntry), false };

0 commit comments

Comments
 (0)