Dominique Pellé wrote:

> On Tue, Sep 29, 2015 at 3:06 PM, Bram Moolenaar \wrote:
> 
> > Patch 7.4.887
> > Problem:    Using uninitialized memory for regexp with back reference.
> >             (Dominique Pelle)
> > Solution:   Initialize end_lnum.
> > Files:      src/regexp_nfa.c
> 
> After this patch, valgrind no longer complains about uninitialized
> memory access when doing...
> 
> $ valgrind --track-origins=yes vim -u NONE -c 'set re=0' -c
> '/\(\&\|\1\)\(x\)' 2> vg.log
> 
> That's good. However, with 'set re=0', vim says: E486: Pattern not
> found: \(\&\|\1\)\(x\)
> whereas with 'set re=1', vim says: E65: Illegal back reference
> 
> In fact, when using the simpler search  /\1  we only get an error
> with the old regexp engine:
> 
> $ vim -u NONE -c 'set re=0' -c '/\1'
> Vim says: search hit BOTTOM, continuing at TOP
> 
> $ vim -u NONE -c 'set re=1' -c '/\1'
> Vim says: E65: Illegal back reference
> 
> Shouldn't both regexp engines give E65 here?

Probably.  Currently it handles an illegal back reference as an empty
string.  Throwing an error might work, not 100% sure.

-- 
How To Keep A Healthy Level Of Insanity:
6. In the memo field of all your checks, write "for sexual favors".

 /// 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