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 коммит произвёл Jean Boussier
Родитель c51d8ff458
Коммит e956ce32c8
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -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;