Blame SOURCES/7.4.051

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.051
22c937
Fcc: outbox
22c937
From: Bram Moolenaar <Bram@moolenaar.net>
22c937
Mime-Version: 1.0
22c937
Content-Type: text/plain; charset=UTF-8
22c937
Content-Transfer-Encoding: 8bit
22c937
------------
22c937
22c937
Patch 7.4.051
22c937
Problem:    Syntax highlighting a Yaml file causes a crash. (Blake Preston)
22c937
Solution:   Copy the pim structure before calling addstate() to avoid it
22c937
	    becoming invalide when the state list is reallocated.
22c937
Files:	    src/regexp_nfa.c
22c937
22c937
22c937
*** ../vim-7.4.050/src/regexp_nfa.c	2013-09-25 18:16:34.000000000 +0200
22c937
--- src/regexp_nfa.c	2013-10-06 15:44:31.000000000 +0200
22c937
***************
22c937
*** 6458,6463 ****
22c937
--- 6458,6464 ----
22c937
  	    if (add_state != NULL)
22c937
  	    {
22c937
  		nfa_pim_T *pim;
22c937
+ 		nfa_pim_T pim_copy;
22c937
  
22c937
  		if (t->pim.result == NFA_PIM_UNUSED)
22c937
  		    pim = NULL;
22c937
***************
22c937
*** 6531,6536 ****
22c937
--- 6532,6546 ----
22c937
  		    pim = NULL;
22c937
  		}
22c937
  
22c937
+ 		/* If "pim" points into l->t it will become invalid when
22c937
+ 		 * adding the state causes the list to be reallocated.  Make a
22c937
+ 		 * local copy to avoid that. */
22c937
+ 		if (pim == &t->pim)
22c937
+ 		{
22c937
+ 		    copy_pim(&pim_copy, pim);
22c937
+ 		    pim = &pim_copy;
22c937
+ 		}
22c937
+ 
22c937
  		if (add_here)
22c937
  		    addstate_here(thislist, add_state, &t->subs, pim, &listidx);
22c937
  		else
22c937
*** ../vim-7.4.050/src/version.c	2013-10-02 21:54:57.000000000 +0200
22c937
--- src/version.c	2013-10-06 15:21:16.000000000 +0200
22c937
***************
22c937
*** 740,741 ****
22c937
--- 740,743 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     51,
22c937
  /**/
22c937
22c937
-- 
22c937
GUARD #2:  It could be carried by an African swallow!
22c937
GUARD #1:  Oh, yeah, an African swallow maybe, but not a European swallow,
22c937
           that's my point.
22c937
GUARD #2:  Oh, yeah, I agree with that...
22c937
                                  The Quest for the Holy Grail (Monty Python)
22c937
22c937
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
22c937
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
22c937
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
22c937
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///