Karsten Hopp c77095
To: vim_dev@googlegroups.com
Karsten Hopp c77095
Subject: Patch 7.4.003
Karsten Hopp c77095
Fcc: outbox
Karsten Hopp c77095
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c77095
Mime-Version: 1.0
Karsten Hopp c77095
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c77095
Content-Transfer-Encoding: 8bit
Karsten Hopp c77095
------------
Karsten Hopp c77095
Karsten Hopp c77095
Patch 7.4.003
Karsten Hopp c77095
Problem:    Memory access error in Ruby syntax highlighting. (Christopher Chow)
Karsten Hopp c77095
Solution:   Refresh stale pointer. (James McCoy)
Karsten Hopp c77095
Files:	    src/regexp_nfa.c
Karsten Hopp c77095
Karsten Hopp c77095
Karsten Hopp c77095
*** ../vim-7.4.002/src/regexp_nfa.c	2013-08-14 13:31:03.000000000 +0200
Karsten Hopp c77095
--- src/regexp_nfa.c	2013-08-14 14:02:06.000000000 +0200
Karsten Hopp c77095
***************
Karsten Hopp c77095
*** 4120,4126 ****
Karsten Hopp c77095
  		sub = &subs->norm;
Karsten Hopp c77095
  	    }
Karsten Hopp c77095
  #ifdef FEAT_SYN_HL
Karsten Hopp c77095
! 	    else if (state->c >= NFA_ZOPEN)
Karsten Hopp c77095
  	    {
Karsten Hopp c77095
  		subidx = state->c - NFA_ZOPEN;
Karsten Hopp c77095
  		sub = &subs->synt;
Karsten Hopp c77095
--- 4120,4126 ----
Karsten Hopp c77095
  		sub = &subs->norm;
Karsten Hopp c77095
  	    }
Karsten Hopp c77095
  #ifdef FEAT_SYN_HL
Karsten Hopp c77095
! 	    else if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
Karsten Hopp c77095
  	    {
Karsten Hopp c77095
  		subidx = state->c - NFA_ZOPEN;
Karsten Hopp c77095
  		sub = &subs->synt;
Karsten Hopp c77095
***************
Karsten Hopp c77095
*** 4189,4194 ****
Karsten Hopp c77095
--- 4189,4201 ----
Karsten Hopp c77095
  	    }
Karsten Hopp c77095
  
Karsten Hopp c77095
  	    subs = addstate(l, state->out, subs, pim, off);
Karsten Hopp c77095
+ 	    /* "subs" may have changed, need to set "sub" again */
Karsten Hopp c77095
+ #ifdef FEAT_SYN_HL
Karsten Hopp c77095
+ 	    if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
Karsten Hopp c77095
+ 		sub = &subs->synt;
Karsten Hopp c77095
+ 	    else
Karsten Hopp c77095
+ #endif
Karsten Hopp c77095
+ 		sub = &subs->norm;
Karsten Hopp c77095
  
Karsten Hopp c77095
  	    if (save_in_use == -1)
Karsten Hopp c77095
  	    {
Karsten Hopp c77095
***************
Karsten Hopp c77095
*** 4237,4243 ****
Karsten Hopp c77095
  		sub = &subs->norm;
Karsten Hopp c77095
  	    }
Karsten Hopp c77095
  #ifdef FEAT_SYN_HL
Karsten Hopp c77095
! 	    else if (state->c >= NFA_ZCLOSE)
Karsten Hopp c77095
  	    {
Karsten Hopp c77095
  		subidx = state->c - NFA_ZCLOSE;
Karsten Hopp c77095
  		sub = &subs->synt;
Karsten Hopp c77095
--- 4244,4250 ----
Karsten Hopp c77095
  		sub = &subs->norm;
Karsten Hopp c77095
  	    }
Karsten Hopp c77095
  #ifdef FEAT_SYN_HL
Karsten Hopp c77095
! 	    else if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
Karsten Hopp c77095
  	    {
Karsten Hopp c77095
  		subidx = state->c - NFA_ZCLOSE;
Karsten Hopp c77095
  		sub = &subs->synt;
Karsten Hopp c77095
***************
Karsten Hopp c77095
*** 4281,4286 ****
Karsten Hopp c77095
--- 4288,4300 ----
Karsten Hopp c77095
  	    }
Karsten Hopp c77095
  
Karsten Hopp c77095
  	    subs = addstate(l, state->out, subs, pim, off);
Karsten Hopp c77095
+ 	    /* "subs" may have changed, need to set "sub" again */
Karsten Hopp c77095
+ #ifdef FEAT_SYN_HL
Karsten Hopp c77095
+ 	    if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
Karsten Hopp c77095
+ 		sub = &subs->synt;
Karsten Hopp c77095
+ 	    else
Karsten Hopp c77095
+ #endif
Karsten Hopp c77095
+ 		sub = &subs->norm;
Karsten Hopp c77095
  
Karsten Hopp c77095
  	    if (REG_MULTI)
Karsten Hopp c77095
  		sub->list.multi[subidx].end = save_lpos;
Karsten Hopp c77095
*** ../vim-7.4.002/src/version.c	2013-08-14 13:31:03.000000000 +0200
Karsten Hopp c77095
--- src/version.c	2013-08-14 14:03:51.000000000 +0200
Karsten Hopp c77095
***************
Karsten Hopp c77095
*** 729,730 ****
Karsten Hopp c77095
--- 729,732 ----
Karsten Hopp c77095
  {   /* Add new patch number below this line */
Karsten Hopp c77095
+ /**/
Karsten Hopp c77095
+     3,
Karsten Hopp c77095
  /**/
Karsten Hopp c77095
Karsten Hopp c77095
-- 
Karsten Hopp c77095
Where do you want to crash today?
Karsten Hopp c77095
Karsten Hopp c77095
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c77095
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c77095
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c77095
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///