1
0
forked from aniani/vim

patch 8.0.0575: using freed memory when resetting 'indentexpr'

Problem:    Using freed memory when resetting 'indentexpr' while evaluating
            it. (Dominique Pelle)
Solution:   Make a copy of 'indentexpr'.
This commit is contained in:
Bram Moolenaar
2017-04-20 22:57:27 +02:00
parent 99895eac1c
commit a701b3b6f0
3 changed files with 26 additions and 1 deletions

View File

@@ -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