summaryrefslogtreecommitdiff
path: root/src/testdir/test_options.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-20 22:57:27 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-20 22:57:27 +0200
commita701b3b6f0f06ac0c9fcc75c6c34a1258fc3b1a2 (patch)
tree23d623833093529287f373c9428ebad70ddb6835 /src/testdir/test_options.vim
parent99895eac1cf71be43ece7e14b50e206e041fbe9f (diff)
downloadvim-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.vim13
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