From c0cf612ccab6b45867b2a4ab3e3565d7dd1b741a Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Thu, 15 Nov 2018 17:28:47 -0800 Subject: Use assert in addition to abort for WASM_UNREACHABLE (#1747) This yields more useful information when something goes wrong. --- src/compiler-support.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler-support.h b/src/compiler-support.h index 5365aa23a..e7cb4db8c 100644 --- a/src/compiler-support.h +++ b/src/compiler-support.h @@ -35,8 +35,9 @@ # include "sanitizer/common_interface_defs.h" # define WASM_UNREACHABLE() do { __sanitizer_print_stack_trace(); __builtin_trap(); } while (0) #else +# include # include -# define WASM_UNREACHABLE() abort() +# define WASM_UNREACHABLE() do { assert(false); abort(); } while (0) #endif #ifdef __GNUC__ -- cgit v1.2.3