diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2020-05-13 18:07:37 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2020-05-13 18:07:37 +0000 |
commit | c79cee71363ddaeb3c5ab7d3ccb87a11e1860d95 (patch) | |
tree | 482bc9b1d4468d4fe52b090605655632d3b00b8e /sys/dev/ow | |
parent | 0721214a60cbfe95fef3fabe256de8f8e62b3427 (diff) | |
download | src-c79cee71363ddaeb3c5ab7d3ccb87a11e1860d95.tar.gz src-c79cee71363ddaeb3c5ab7d3ccb87a11e1860d95.zip |
kernel: provide panicky version of __unreachable
__builtin_unreachable doesn't raise any compile-time warnings/errors on its
own, so problems with its usage can't be easily detected. While it would be
nice for this situation to change and compilers to at least add a warning
for trivial cases where local state means the instruction can't be reached,
this isn't the case at the moment and likely will not happen.
This commit adds an __assert_unreachable, whose intent is incredibly clear:
it asserts that this instruction is unreachable. On INVARIANTS builds, it's
a panic(), and on non-INVARIANTS it expands to __unreachable().
Existing users of __unreachable() are converted to __assert_unreachable,
to improve debuggability if this assumption is violated.
Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D23793
Notes
Notes:
svn path=/head/; revision=361011
Diffstat (limited to 'sys/dev/ow')
-rw-r--r-- | sys/dev/ow/ow.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ow/ow.c b/sys/dev/ow/ow.c index eda33ea986d4..a6583accaa59 100644 --- a/sys/dev/ow/ow.c +++ b/sys/dev/ow/ow.c @@ -507,7 +507,7 @@ again: return (EIO); goto again; default: /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); } if (dir) { OWLL_WRITE_ONE(lldev, &timing_regular); |