Use rb_bug instead of UNREACHABLE for assertions

UNREACHABLE uses __builtin_unreachable which is not intended to be used
as an assertion.
This commit is contained in:
Peter Zhu 2024-09-24 13:45:12 -04:00 committed by Jean Boussier
parent c51d8ff458
commit e956ce32c8
Notes: git 2024-09-24 18:55:13 +00:00

View File

@ -3763,9 +3763,7 @@ rb_str_append_as_bytes(int argc, VALUE *argv, VALUE str)
break; break;
} }
default: default:
UNREACHABLE; rb_bug("append_as_bytes arguments should have been validated");
RUBY_ASSERT("append_as_bytes arguments should have been validated");
break;
} }
} }
@ -3793,9 +3791,7 @@ rb_str_append_as_bytes(int argc, VALUE *argv, VALUE str)
break; break;
} }
default: default:
UNREACHABLE; rb_bug("append_as_bytes arguments should have been validated");
RUBY_ASSERT("append_as_bytes arguments should have been validated");
break;
} }
} }
break; break;