From ec506192a7a0739a862568cc8bb8c904e702db78 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 11 Feb 2019 15:53:13 +0100 Subject: compat/macros: define unreachable() more sensibly --- compat/macros1.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat/macros1.h b/compat/macros1.h index 96c09af4..915b8d29 100644 --- a/compat/macros1.h +++ b/compat/macros1.h @@ -37,7 +37,7 @@ #define PP_EXPAND3(x) x #ifdef _MSC_VER -# define unreachable() __assume(0) +# define unreachable() do { __assume(0); *(volatile int*)nullptr = 0; } while (0) /* NOLINT(clang-analyzer-core.NullDereference) */ #else -# define unreachable() __builtin_unreachable() +# define unreachable() do { __builtin_unreachable(); *(volatile int*)nullptr = 0; } while (0) /* NOLINT(clang-analyzer-core.NullDereference) */ #endif -- cgit v1.2.3