summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.051
blob: ca5c3a04e9aaff2f39a0099f5f58c581842ef0d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
To: vim_dev@googlegroups.com
Subject: Patch 7.4.051
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.051
Problem:    Syntax highlighting a Yaml file causes a crash. (Blake Preston)
Solution:   Copy the pim structure before calling addstate() to avoid it
	    becoming invalide when the state list is reallocated.
Files:	    src/regexp_nfa.c


*** ../vim-7.4.050/src/regexp_nfa.c	2013-09-25 18:16:34.000000000 +0200
--- src/regexp_nfa.c	2013-10-06 15:44:31.000000000 +0200
***************
*** 6458,6463 ****
--- 6458,6464 ----
  	    if (add_state != NULL)
  	    {
  		nfa_pim_T *pim;
+ 		nfa_pim_T pim_copy;
  
  		if (t->pim.result == NFA_PIM_UNUSED)
  		    pim = NULL;
***************
*** 6531,6536 ****
--- 6532,6546 ----
  		    pim = NULL;
  		}
  
+ 		/* If "pim" points into l->t it will become invalid when
+ 		 * adding the state causes the list to be reallocated.  Make a
+ 		 * local copy to avoid that. */
+ 		if (pim == &t->pim)
+ 		{
+ 		    copy_pim(&pim_copy, pim);
+ 		    pim = &pim_copy;
+ 		}
+ 
  		if (add_here)
  		    addstate_here(thislist, add_state, &t->subs, pim, &listidx);
  		else
*** ../vim-7.4.050/src/version.c	2013-10-02 21:54:57.000000000 +0200
--- src/version.c	2013-10-06 15:21:16.000000000 +0200
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     51,
  /**/

-- 
GUARD #2:  It could be carried by an African swallow!
GUARD #1:  Oh, yeah, an African swallow maybe, but not a European swallow,
           that's my point.
GUARD #2:  Oh, yeah, I agree with that...
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- 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    ///