diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-11 15:53:13 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-11 18:44:03 +0100 |
commit | ec506192a7a0739a862568cc8bb8c904e702db78 (patch) | |
tree | 65dc6c23fcc607b1f2995c273e759ae16d3c0630 /compat/macros1.h | |
parent | aa3b01a556a60ce09123e93263642193da86982b (diff) |
compat/macros: define unreachable() more sensibly
Diffstat (limited to 'compat/macros1.h')
-rw-r--r-- | compat/macros1.h | 4 |
1 files 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 |