summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-02-11 15:53:13 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-02-11 18:44:03 +0100
commitec506192a7a0739a862568cc8bb8c904e702db78 (patch)
tree65dc6c23fcc607b1f2995c273e759ae16d3c0630 /compat
parentaa3b01a556a60ce09123e93263642193da86982b (diff)
compat/macros: define unreachable() more sensibly
Diffstat (limited to 'compat')
-rw-r--r--compat/macros1.h4
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