Skip to content

Commit dbb97bc

Browse files
kateinoigakukunrunner
authored andcommitted
[stdlib] Fix calling convention mismatch for swift_COWChecksEnabled
`ContiguousArrayBuffer.swift` calls `swift_COWChecksEnabled` with the Swift calling convention, but the functions is defined with the C calling convention. This mismatch actually happens only when building with `enable-array-cow-checks` (which is not enabled by default). Also ideal fix would be to put `@_cdecl` on the function declared in Swift-side to choose the correct calling convention. `@cdecl` without body is not supported yet but discussed in https://forums.swift.org/t/formalizing-cdecl/40677
1 parent bb22f1a commit dbb97bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/runtime/EnvironmentVariables.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ void swift::runtime::environment::initialize(void *context) {
253253
}
254254
#endif
255255

256+
SWIFT_CC(swift)
256257
SWIFT_RUNTIME_EXPORT
257258
bool swift_COWChecksEnabled() {
258259
return runtime::environment::SWIFT_DEBUG_ENABLE_COW_CHECKS();

0 commit comments

Comments
 (0)