Skip to content

Commit

Permalink
RBIMPL_UNREACHABLE_RETURN: evaluate the argument
Browse files Browse the repository at this point in the history
Prevent casual typos inside of UNREACHABLE_RETURN(...).
  • Loading branch information
shyouhei committed Jun 29, 2020
1 parent bacd03e commit c8dc2bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/ruby/internal/assume.h
Expand Up @@ -42,7 +42,7 @@

/** Wraps (or simulates) `__builtin_unreachable`. */
#if RBIMPL_HAS_BUILTIN(__builtin_unreachable)
# define RBIMPL_UNREACHABLE_RETURN(_) __builtin_unreachable()
# define RBIMPL_UNREACHABLE_RETURN(_) (__builtin_unreachable(), (_))

#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_UNREACHABLE_RETURN(_) return (__assume(0), (_))
Expand Down

0 comments on commit c8dc2bf

Please sign in to comment.