On Sun, 2009-04-26 at 23:53 +0200, Dominique Pellé wrote:
> Robert Bragg <[email protected]> wrote:
> 
> > Hi,
> >
> > So it turns out, I'm the only one in the world that wants more than 8
> > cscope connections, but I really do :-)
> 
> Please find attached a patch (against Vim-7.2.160) that performs
> dynamic allocation of cscope connections.  It gets rid of the
> hard-coded limitation of 8 connections max (no limit anymore).
Excellent, thanks. I started to take a look but it looks like you've
beat me to it. :-)

> 
> Remark: while writing the patch, I found and fixed a bug in
> if_cscope.c:1595:
> 
> 1595    if ((i >= CSCOPE_MAX_CONNECTIONS || i < -1 || csinfo[i].fname == NULL)
> 1596      && i != -1)
> 
> This was incorrect:  'i' can be -1  (when doing ":cs kill -1") and it
> then accessed csinfo[-1].fname (illegal memory access).  Valgrind
> could not detect it because csinfo was in .bss section before patch
> and Valgrind does not know about boundaries of buffers in .bss.
> But Valgrind could detect the bug when csinfo is dynamically
> allocated.

Right I also spotted the same bug, cool.

thanks again Dominique,
-- Robert



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui