Skip to content

Commit 8b3a15b

Browse files
zhuoweistephentyrone
authored andcommitted
[stdlib] Fix return type of swift_{uint64,int64,float*}ToString (#24181)
The return type of these functions are uint64_t in Stubs.cpp but UInt in the Swift code; this changes the Swift code to match the C++ return type. Found when compiling the stdlib for WebAssembly, which requires that all return types match: UInt maps to i32 while uint64_t maps to i64, so functions calling these functions fail the validation.
1 parent 22ed240 commit 8b3a15b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/Runtime.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ internal func _float${bits}ToStringImpl(
161161
_ buffer: UnsafeMutablePointer<UTF8.CodeUnit>,
162162
_ bufferLength: UInt, _ value: Float${bits},
163163
_ debug: Bool
164-
) -> UInt
164+
) -> UInt64
165165

166166
internal func _float${bits}ToString(
167167
_ value: Float${bits}, debug: Bool
@@ -185,7 +185,7 @@ internal func _int64ToStringImpl(
185185
_ buffer: UnsafeMutablePointer<UTF8.CodeUnit>,
186186
_ bufferLength: UInt, _ value: Int64,
187187
_ radix: Int64, _ uppercase: Bool
188-
) -> UInt
188+
) -> UInt64
189189

190190
internal func _int64ToString(
191191
_ value: Int64, radix: Int64 = 10, uppercase: Bool = false
@@ -213,7 +213,7 @@ internal func _int64ToString(
213213
internal func _uint64ToStringImpl(
214214
_ buffer: UnsafeMutablePointer<UTF8.CodeUnit>,
215215
_ bufferLength: UInt, _ value: UInt64, _ radix: Int64, _ uppercase: Bool
216-
) -> UInt
216+
) -> UInt64
217217

218218
public // @testable
219219
func _uint64ToString(

0 commit comments

Comments
 (0)