Problem: Using :arglocal in an autocommand may use freed memory.
(houyunsong)
Solution: Check if the arglist is locked.
if (eap->cmdidx != CMD_args)
{
+ if (check_arglist_locked() == FAIL)
+ return;
alist_unlink(ALIST(curwin));
if (eap->cmdidx == CMD_argglobal)
ALIST(curwin) = &global_alist;
if (*eap->arg != NUL)
{
+ if (check_arglist_locked() == FAIL)
+ return;
// ":args file ..": define new argument list, handle like ":next"
// Also for ":argslocal file .." and ":argsglobal file ..".
ex_next(eap);
%bwipe!
endfunc
+" This was using freed memory.
+func Test_BufNew_arglocal()
+ arglocal
+ au BufNew * arglocal
+ call assert_fails('drop xx', 'E1156:')
+
+ au! BufNew
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2463,
/**/
2462,
/**/