diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-03 09:23:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-03 03:23:45 -0400 |
| commit | 9a8966879a051aad5e870f30d1c6c77a1a588186 (patch) | |
| tree | 3ba7ecb40016949bea47a6d783e48d0ab14a3c51 /runtime/lua/vim/_stringbuffer.lua | |
| parent | b51a0b2dccb78151ae02b12ef32e0a6b623006d3 (diff) | |
| download | rneovim-9a8966879a051aad5e870f30d1c6c77a1a588186.tar.gz rneovim-9a8966879a051aad5e870f30d1c6c77a1a588186.tar.bz2 rneovim-9a8966879a051aad5e870f30d1c6c77a1a588186.zip | |
fix(iter): keep take() predicate within bounds #41635
Problem:
`IterArray:take()` iterates up to `self._tail`, but `_tail` is
exclusive. When no element fails the predicate, the loop reads one index
past the last element and calls the predicate with `nil`.
Solution:
Stop at `self._tail - inc`, which is the last in-range index for both
iteration directions. Add tests using a predicate which dereferences its
argument and matches every element, forward and reversed.
AI-assisted
Diffstat (limited to 'runtime/lua/vim/_stringbuffer.lua')
0 files changed, 0 insertions, 0 deletions