fix out-of-bounds load on empty replxx line

`chars[0] == ')'` was branching on empty data; not UB due to custom heap
usage and the code that does run is harmless, but still hit under
valgrind
This commit is contained in:
dzaima 2024-07-31 03:03:11 +03:00
parent bdb5781ef7
commit d1469df96b

View File

@ -260,6 +260,8 @@ static NOINLINE i64 readInt(char** p) {
return c;
}
NOINLINE void completion_impl(const char* inp, void* res, bool hint, int* dist) {
if (!*inp) return;
CATCH_OOM(return)
B inpB = toC32Any(utf8Decode0(inp));
u32* chars = c32any_ptr(inpB);