aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-24 16:23:59 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commitde3e931df7abdc3ee22dbb7543e86af6d00ee899 (patch)
tree63f8471b59282d2ca5e7af0282f34d9cfef14ee1 /proc.c
parentc8dc2bf1401fc01d35a4a7587ed224f1f2fe29e6 (diff)
downloadruby-de3e931df7abdc3ee22dbb7543e86af6d00ee899.tar.gz
add UNREACHABLE_RETURN
Not every compilers understand that rb_raise does not return. When a function does not end with a return statement, such compilers can issue warnings. We would better tell them about reachabilities.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 27806306ab..eb3e4bb73e 100644
--- a/proc.c
+++ b/proc.c
@@ -549,6 +549,7 @@ bind_local_variable_get(VALUE bindval, VALUE sym)
undefined:
rb_name_err_raise("local variable `%1$s' is not defined for %2$s",
bindval, sym);
+ UNREACHABLE_RETURN(Qundef);
}
/*
@@ -2021,6 +2022,7 @@ rb_obj_singleton_method(VALUE obj, VALUE vid)
/* undef: */
rb_name_err_raise("undefined singleton method `%1$s' for `%2$s'",
obj, vid);
+ UNREACHABLE_RETURN(Qundef);
}
/*