Skip to content

Commit c0cf612

Browse files
authored
Use assert in addition to abort for WASM_UNREACHABLE (#1747)
This yields more useful information when something goes wrong.
1 parent 991bd33 commit c0cf612

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler-support.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
# include "sanitizer/common_interface_defs.h"
3636
# define WASM_UNREACHABLE() do { __sanitizer_print_stack_trace(); __builtin_trap(); } while (0)
3737
#else
38+
# include <assert.h>
3839
# include <stdlib.h>
39-
# define WASM_UNREACHABLE() abort()
40+
# define WASM_UNREACHABLE() do { assert(false); abort(); } while (0)
4041
#endif
4142

4243
#ifdef __GNUC__

0 commit comments

Comments
 (0)