summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-09 13:52:13 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-10 16:05:01 +0900
commit3a3033c138c0951ad5edbf02b5c233b58a190d2f (patch)
treec442a263e5934eb8109d5e1d6428ebe75b1c1b65 /internal
parent6c7d39aabed9b70b6bf13cc27c2bff086cd99bda (diff)
get rid of using `__builtin_unreachable` directly [Bug #17787]
As it is an independent feature from `clz`, `ctz` and `popcount`, it might be unavailable even if the latters are built in.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4372
Diffstat (limited to 'internal')
-rw-r--r--internal/bits.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/bits.h b/internal/bits.h
index a7ddcaeb78..746947bfc2 100644
--- a/internal/bits.h
+++ b/internal/bits.h
@@ -284,7 +284,7 @@ nlz_int64(uint64_t x)
}
else {
/* :FIXME: Is there a way to make this branch a compile-time error? */
- __builtin_unreachable();
+ UNREACHABLE_RETURN(~0);
}
#else
@@ -419,7 +419,7 @@ rb_popcount64(uint64_t x)
}
else {
/* :FIXME: Is there a way to make this branch a compile-time error? */
- __builtin_unreachable();
+ UNREACHABLE_RETURN(~0);
}
#else
@@ -492,7 +492,7 @@ ntz_int64(uint64_t x)
}
else {
/* :FIXME: Is there a way to make this branch a compile-time error? */
- __builtin_unreachable();
+ UNREACHABLE_RETURN(~0);
}
#else