Yegappan wrote:
> >> In all the places where qf_restore_list() is currently invoked, there
> >> is a call to
> >> qflist_valid() to check whether the list with the specified id is
> >> present or not.
> >> If the list is not present, then qf_restore_list() is not called. But
> >> in the future,
> >> someone might call qf_restore_list() without first checking whether the
> >> list
> >> is still present in the stack or not.
> >
> > Yes, so the current construction is brittle, if someone makes changes
> > and forgets to call qflist_valid() then things break. That's basically
> > what Coverity complains about: unless you are careful qf_curlist becomes
> > negative.
> >
> > We should move qflist_valid() into qf_restore_list(), and let it return
> > FAIL when the list isn't valid.
> >
>
> There is no need to call qflist_valid() in qf_restore_list() as the qf_id2nr()
> function (called by qf_restore_list()) already iterates through all the lists
> in the stack.
>
> >
> > Then the caller must deal with the
> > failure. This also applies to qf_jump_first() indirectly.
> >
> > Can you make it work like that?
>
> I am attaching a patch that does this.
Thanks!
--
BRIDGEKEEPER: What is your favorite colour?
GAWAIN: Blue ... No yelloooooww!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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.