summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-24 16:19:55 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commitc8dc2bf1401fc01d35a4a7587ed224f1f2fe29e6 (patch)
tree329904f61f54f3b0ad944c557330d2f447aadeaf
parentbacd03ebdfdd3940084cb54ffc0c2a75b0a4e8d0 (diff)
RBIMPL_UNREACHABLE_RETURN: evaluate the argument
Prevent casual typos inside of UNREACHABLE_RETURN(...).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3247
-rw-r--r--include/ruby/internal/assume.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/internal/assume.h b/include/ruby/internal/assume.h
index e95b2fb12a..5af1c3c974 100644
--- a/include/ruby/internal/assume.h
+++ b/include/ruby/internal/assume.h
@@ -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), (_))