Skip to content

Commit ebb21f5

Browse files
committed
runtime: avoid UB on Windows x86_64 builds
Use the `ull` extension rather than `l` for LLP64 environment support. Fixes UB on the Windows x86_64 port.
1 parent a1eb1fe commit ebb21f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/runtime/SwiftDtoa.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ size_t swift_format_double(double d, char *dest, size_t length)
10901090
uint64_t raw = bitPatternForDouble(d);
10911091
const char *sign = signbit(d) ? "-" : "";
10921092
const char *signaling = ((raw >> (significandBitCount - 1)) & 1) ? "" : "s";
1093-
uint64_t payload = raw & ((1L << (significandBitCount - 2)) - 1);
1093+
uint64_t payload = raw & ((1ull << (significandBitCount - 2)) - 1);
10941094
char buff[32];
10951095
if (payload != 0) {
10961096
snprintf(buff, sizeof(buff), "%s%snan(0x%llx)",

0 commit comments

Comments
 (0)