diff options
| author | Michael Ennen <mike.ennen@gmail.com> | 2016-12-19 17:24:21 -0700 |
|---|---|---|
| committer | Michael Ennen <mike.ennen@gmail.com> | 2017-02-14 17:38:19 -0700 |
| commit | bae8a19c63381c3f6c860bae75af3580d68bf3b3 (patch) | |
| tree | d649a6fb31138740fd38d1977b274bc3a36cf9de /src/nvim/testdir | |
| parent | effe760b134589f8024d6a5f1cb2c7b979054937 (diff) | |
| download | rneovim-bae8a19c63381c3f6c860bae75af3580d68bf3b3.tar.gz rneovim-bae8a19c63381c3f6c860bae75af3580d68bf3b3.tar.bz2 rneovim-bae8a19c63381c3f6c860bae75af3580d68bf3b3.zip | |
vim-patch:7.4.2235
Problem: submatch() does not check for a valid argument.
Solution: Give an error if the argument is out of range. (Dominique Pelle)
https://github.com/vim/vim/commit/989f592f7ffcbafdc4ec35cee4dc65bd053e2077
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_expr.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 3b87c4b087..7ceef2834f 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -125,6 +125,11 @@ func Test_substitute_expr() call assert_equal('--', substitute('xxx', 'x*', {-> '-' . Recurse() . '-'}, '')) endfunc +func Test_invalid_submatch() + " This was causing invalid memory access in Vim-7.4.2232 and older + call assert_fails("call substitute('x', '.', {-> submatch(10)}, '')", 'E935:') +endfunc + func Test_substitute_expr_arg() call assert_equal('123456789-123456789=', substitute('123456789', \ '\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', |