From e956ce32c8f7d1b1c57ed109f91979173ff22c36 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 24 Sep 2024 13:45:12 -0400 Subject: [PATCH] Use rb_bug instead of UNREACHABLE for assertions UNREACHABLE uses __builtin_unreachable which is not intended to be used as an assertion. --- string.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/string.c b/string.c index dee17c86a6..0b3878b9b1 100644 --- a/string.c +++ b/string.c @@ -3763,9 +3763,7 @@ rb_str_append_as_bytes(int argc, VALUE *argv, VALUE str) break; } default: - UNREACHABLE; - RUBY_ASSERT("append_as_bytes arguments should have been validated"); - break; + rb_bug("append_as_bytes arguments should have been validated"); } } @@ -3793,9 +3791,7 @@ rb_str_append_as_bytes(int argc, VALUE *argv, VALUE str) break; } default: - UNREACHABLE; - RUBY_ASSERT("append_as_bytes arguments should have been validated"); - break; + rb_bug("append_as_bytes arguments should have been validated"); } } break;