summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-09-24 13:45:12 -0400
committerJean Boussier <jean.boussier@gmail.com>2024-09-24 14:54:55 -0400
commite956ce32c8f7d1b1c57ed109f91979173ff22c36 (patch)
tree9d8295bb429acc7da33a35ce90adfc5d137f6217 /string.c
parentc51d8ff458e00b34e03b1fd5ac9bb0665c5a516a (diff)
Use rb_bug instead of UNREACHABLE for assertions
UNREACHABLE uses __builtin_unreachable which is not intended to be used as an assertion.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11678
Diffstat (limited to 'string.c')
-rw-r--r--string.c8
1 files 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;