Yegappan wrote:

> On Sun, Apr 22, 2018 at 8:51 AM, Nikolai Aleksandrovich Pavlov
> <[email protected]> wrote:
> > This is another error reported by PVS, though I now have no opinion on what
> > to do with this. Offending code is qi != save_qi condition in
> >
> >     /* Autocommands may change the list. Save it for later comparison */
> >     save_qi = qi;
> > …
> > if (!new_qi && qi != save_qi && qf_find_buf(qi) == NULL)
> >    /* autocommands made "qi" invalid */
> >    return;
> >
> > The problem here is that if you analyze the code between assigning save_qi
> > and qi you will see that
> >
> > There are no goto to the location before assigning save_qi, specifically to
> > the start of the function where qi is initially assigned. Actually no labels
> > anywhere in function.
> > qi is not assigned to.
> > &qi is not passed anywhere in the whole function (qi is passed, but it would
> > do nothing to mess with save_qi == qi condition). And it is a local
> > variable, so it would not be possible to change it otherwise.
> >
> > This means no matter what, autocommands cannot “make "qi" invalid” like
> > comment suggests as long as qi != save_qi is inside a condition. Also
> > autocommands may not change qi, only whatever memory qi points to.
> > Obviously, code is somehow wrong. But I do not know what is the right
> > variant.
> >
> 
> Instead of save_qi, it should have been &ql_info. The if condition is checking
> whether qi is pointing to a quickfix or a location list. I am attaching a test
> that will crash Vim without this change. The patch with the test is attached.

Thanks for the fix!  And thanks to Nikolai for spotting the problem.


-- 
hundred-and-one symptoms of being an internet addict:
256. You are able to write down over 250 symptoms of being an internet
     addict, even though they only asked for 101.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui