diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2024-09-24 13:45:12 -0400 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2024-09-24 14:54:55 -0400 |
| commit | e956ce32c8f7d1b1c57ed109f91979173ff22c36 (patch) | |
| tree | 9d8295bb429acc7da33a35ce90adfc5d137f6217 /string.c | |
| parent | c51d8ff458e00b34e03b1fd5ac9bb0665c5a516a (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.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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; |
