diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-04-20 22:57:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-04-20 22:57:27 +0200 |
commit | a701b3b6f0f06ac0c9fcc75c6c34a1258fc3b1a2 (patch) | |
tree | 23d623833093529287f373c9428ebad70ddb6835 /src/testdir/test_options.vim | |
parent | 99895eac1cf71be43ece7e14b50e206e041fbe9f (diff) | |
download | vim-git-a701b3b6f0f06ac0c9fcc75c6c34a1258fc3b1a2.tar.gz |
patch 8.0.0575: using freed memory when resetting 'indentexpr'v8.0.0575
Problem: Using freed memory when resetting 'indentexpr' while evaluating
it. (Dominique Pelle)
Solution: Make a copy of 'indentexpr'.
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index d72ca74b2..5d2033a5d 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -319,3 +319,16 @@ func Test_set_values() throw 'Skipped: opt_test.vim does not exist' endif endfunc + +func ResetIndentexpr() + set indentexpr= +endfunc + +func Test_set_indentexpr() + " this was causing usage of freed memory + set indentexpr=ResetIndentexpr() + new + call feedkeys("i\<c-f>", 'x') + call assert_equal('', &indentexpr) + bwipe! +endfunc |