Skip to content

Commit

Permalink
get rid of using __builtin_unreachable directly [Bug #17787]
Browse files Browse the repository at this point in the history
As it is an independent feature from `clz`, `ctz` and `popcount`,
it might be unavailable even if the latters are built in.
  • Loading branch information
nobu committed Apr 10, 2021
1 parent 6c7d39a commit 3a3033c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3a3033c

Please sign in to comment.