Skip to content

Commit 12c9c93

Browse files
committed
[Memory64] sanitizer header changes for 64-bit
1 parent b55a3c3 commit 12c9c93

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ struct __sanitizer_file_handle {
427427
};
428428
#endif
429429

430-
#if SANITIZER_MAC
430+
// These fields are not actually pointers, and so wasm64 must use unsigned and not uptr for them
431+
#if SANITIZER_MAC || SANITIZER_EMSCRIPTEN
431432
struct __sanitizer_msghdr {
432433
void *msg_name;
433434
unsigned msg_namelen;

system/lib/compiler-rt/lib/ubsan/ubsan_flags.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,18 @@ void InitializeFlags() {
7575
parser.ParseString(__ubsan_default_options());
7676
// Override from environment variable.
7777
#if SANITIZER_EMSCRIPTEN
78+
#ifdef __wasm64__
79+
// FIXME: support UBSAN in wasm64.
80+
abort();
81+
#else
7882
char *options = (char*) EM_ASM_INT({
7983
return withBuiltinMalloc(function () {
8084
return allocateUTF8(Module['UBSAN_OPTIONS'] || 0);
8185
});
8286
});
8387
parser.ParseString(options);
8488
emscripten_builtin_free(options);
89+
#endif
8590
#else
8691
parser.ParseStringFromEnv("UBSAN_OPTIONS");
8792
#endif // SANITIZER_EMSCRIPTEN

0 commit comments

Comments
 (0)