Fix undefined behavior in String#append_as_bytes
The UNREACHABLE macro calls __builtin_unreachable, which according to the [GCC docs](https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005funreachable): > If control flow reaches the point of the __builtin_unreachable, the > program is undefined. But it can reach this point with the following script: "123".append_as_bytes("123") This can crash on some platforms with a `Trace/BPT trap: 5`.
This commit is contained in:
parent
4f0fe97995
commit
c51d8ff458
Notes:
git
2024-09-24 18:55:14 +00:00