balazske wrote: The change looks correct, but it would be more accurate if 3 different index error cases would be possible, index is too small (negative), too large, or can be both too small and too large. https://github.com/llvm/llvm-project/pull/84201