comparison src/testdir/test_tagfunc.vim @ 29814:1aec47ab35f0 v9.0.0246

patch 9.0.0246: using freed memory when 'tagfunc' deletes the buffer Commit: https://github.com/vim/vim/commit/adce965162dd89bf29ee0e5baf53652e7515762c Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 22 16:35:45 2022 +0100 patch 9.0.0246: using freed memory when 'tagfunc' deletes the buffer Problem: Using freed memory when 'tagfunc' deletes the buffer. Solution: Make a copy of the tag name.
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Aug 2022 17:45:03 +0200
parents 19367412787c
children 0e9b58353412
comparison
equal deleted inserted replaced
29813:dfd9d7ab4a5a 29814:1aec47ab35f0
387 delfunc TagFunc2 387 delfunc TagFunc2
388 set tagfunc& 388 set tagfunc&
389 %bw! 389 %bw!
390 endfunc 390 endfunc
391 391
392 func Test_tagfunc_wipes_buffer()
393 func g:Tag0unc0(t,f,o)
394 bwipe
395 endfunc
396 set tagfunc=g:Tag0unc0
397 new
398 cal assert_fails('tag 0', 'E987:')
399
400 delfunc g:Tag0unc0
401 set tagfunc=
402 endfunc
403
392 " vim: shiftwidth=2 sts=2 expandtab 404 " vim: shiftwidth=2 sts=2 expandtab