Problem: Accessing freed memory in :cbuffer.
Solution: Get quickfix list after executing autocmds. (closes #2470)
#endif
int res;
- if (eap->cmdidx == CMD_lbuffer || eap->cmdidx == CMD_lgetbuffer
- || eap->cmdidx == CMD_laddbuffer)
- {
- qi = ll_get_or_alloc_list(curwin);
- if (qi == NULL)
- return;
- }
-
#ifdef FEAT_AUTOCMD
switch (eap->cmdidx)
{
}
#endif
+ /* Must come after autocommands. */
+ if (eap->cmdidx == CMD_lbuffer || eap->cmdidx == CMD_lgetbuffer
+ || eap->cmdidx == CMD_laddbuffer)
+ {
+ qi = ll_get_or_alloc_list(curwin);
+ if (qi == NULL)
+ return;
+ }
+
if (*eap->arg == NUL)
buf = curbuf;
else if (*skipwhite(skipdigits(eap->arg)) == NUL)
call assert_fails('lv½ /x', 'E480')
au!
endfunc
+
+func Test_wipe_cbuffer()
+ sv x
+ au * * bw
+ lb
+ au!
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1413,
/**/
1412,
/**/