diff options
author | Derek Schuff <dschuff@chromium.org> | 2017-06-30 13:28:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 13:28:42 -0700 |
commit | d1ccc3d33adb191e6728cd136ef6596d98e2a716 (patch) | |
tree | 9224fee3e507bcfc7c892168fe24044f812289f6 /src/compiler-support.h | |
parent | e488da5adbef2613c08fe205db5b79b1765a4af3 (diff) | |
download | binaryen-d1ccc3d33adb191e6728cd136ef6596d98e2a716.tar.gz binaryen-d1ccc3d33adb191e6728cd136ef6596d98e2a716.tar.bz2 binaryen-d1ccc3d33adb191e6728cd136ef6596d98e2a716.zip |
Use sanitizer runtime to print pretty stack traces on unreachable (#1079)
For even better debugging support.
Diffstat (limited to 'src/compiler-support.h')
-rw-r--r-- | src/compiler-support.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler-support.h b/src/compiler-support.h index f2e58ff5e..f105271b5 100644 --- a/src/compiler-support.h +++ b/src/compiler-support.h @@ -31,6 +31,9 @@ # define WASM_UNREACHABLE() __builtin_unreachable() #elif defined(_MSC_VER) # define WASM_UNREACHABLE() __assume(false) +#elif __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +# include "sanitizer/common_interface_defs.h" +# define WASM_UNREACHABLE() do { __sanitizer_print_stack_trace(); __builtin_trap(); } while (0) #else # include <stdlib.h> # define WASM_UNREACHABLE() abort() |