Skip to content

Commit 35a1f08

Browse files
more fixes for 32bits
1 parent ef9ccdb commit 35a1f08

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

libc/include/llvm-libc-types/jmp_buf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ typedef struct {
5151
#error "__jmp_buf not available for your target architecture."
5252
#endif
5353
// unused if checksum feature is not enabled.
54-
__UINT64_TYPE__ __chksum;
54+
__UINTPTR_TYPE__ __chksum;
5555
} __jmp_buf;
5656

5757
typedef __jmp_buf jmp_buf[1];

libc/src/setjmp/checksum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ namespace LIBC_NAMESPACE_DECL {
1515
namespace jmpbuf {
1616

1717
extern __UINTPTR_TYPE__ value_mask;
18-
extern __UINT64_TYPE__ checksum_cookie;
18+
extern __UINTPTR_TYPE__ checksum_cookie;
1919

2020
// abitrary prime number
21-
LIBC_INLINE constexpr __UINT64_TYPE__ ROTATION = 13;
21+
LIBC_INLINE constexpr __UINTPTR_TYPE__ ROTATION = 13;
2222
void initialize();
2323
extern "C" [[gnu::cold, noreturn]] void __libc_jmpbuf_corruption();
2424
} // namespace jmpbuf

libc/src/setjmp/linux/checksum.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ namespace LIBC_NAMESPACE_DECL {
1515
namespace jmpbuf {
1616
// random bytes from https://www.random.org/cgi-bin/randbyte?nbytes=8&format=h
1717
// the cookie should not be zero otherwise it will be a bad seed as a multiplier
18-
__UINTPTR_TYPE__ value_mask = 0x3899'f0d3'5005'd953;
19-
__UINT64_TYPE__ checksum_cookie = 0xc7d9'd341'6afc'33f2;
18+
__UINTPTR_TYPE__ value_mask =
19+
static_cast<__UINTPTR_TYPE__>(0x3899'f0d3'5005'd953ull);
20+
__UINTPTR_TYPE__ checksum_cookie =
21+
static_cast<__UINTPTR_TYPE__>(0xc7d9'd341'6afc'33f2ull);
2022

2123
// initialize the checksum state
2224
void initialize() {

0 commit comments

Comments
 (0)