Index: lib/sanitizer_common/sanitizer_win.cc =================================================================== --- lib/sanitizer_common/sanitizer_win.cc +++ lib/sanitizer_common/sanitizer_win.cc @@ -31,6 +31,16 @@ #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" +#if defined(__clang__) +# define BUILTIN_UNREACHABLE() __builtin_unreachable() +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) +# define BUILTIN_UNREACHABLE() __builtin_unreachable() +#elif defined(_MSC_VER) +# define BUILTIN_UNREACHABLE() __assume(0) +#else +# define BUILTIN_UNREACHABLE() abort() +#endif + namespace __sanitizer { #include "sanitizer_syscall_generic.inc" @@ -659,7 +669,7 @@ if (::IsDebuggerPresent()) __debugbreak(); TerminateProcess(GetCurrentProcess(), exitcode); - __assume(0); + BUILTIN_UNREACHABLE(); } uptr internal_ftruncate(fd_t fd, uptr size) {