Karsten Hopp ac136e
To: vim-dev@vim.org
Karsten Hopp ac136e
Subject: Patch 7.0.025
Karsten Hopp ac136e
Fcc: outbox
Karsten Hopp ac136e
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp ac136e
Mime-Version: 1.0
Karsten Hopp ac136e
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp ac136e
Content-Transfer-Encoding: 8bit
Karsten Hopp ac136e
------------
Karsten Hopp ac136e
Karsten Hopp ac136e
Patch 7.0.025
Karsten Hopp ac136e
Problem:    Crash when removing an element of a:000.  (Nikolai Weibull)
Karsten Hopp ac136e
Solution:   Mark the a:000 list with VAR_FIXED.
Karsten Hopp ac136e
Files:	    src/eval.c
Karsten Hopp ac136e
Karsten Hopp ac136e
Karsten Hopp ac136e
*** ../vim-7.0.024/src/eval.c	Thu Jun 22 17:33:49 2006
Karsten Hopp ac136e
--- src/eval.c	Thu Jun 22 17:56:50 2006
Karsten Hopp ac136e
***************
Karsten Hopp ac136e
*** 13250,13256 ****
Karsten Hopp ac136e
  	if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp ac136e
  	    EMSG2(_(e_toomanyarg), "remove()");
Karsten Hopp ac136e
  	else if ((d = argvars[0].vval.v_dict) != NULL
Karsten Hopp ac136e
! 		&& !tv_check_lock(d->dv_lock, (char_u *)"remove()"))
Karsten Hopp ac136e
  	{
Karsten Hopp ac136e
  	    key = get_tv_string_chk(&argvars[1]);
Karsten Hopp ac136e
  	    if (key != NULL)
Karsten Hopp ac136e
--- 13254,13260 ----
Karsten Hopp ac136e
  	if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp ac136e
  	    EMSG2(_(e_toomanyarg), "remove()");
Karsten Hopp ac136e
  	else if ((d = argvars[0].vval.v_dict) != NULL
Karsten Hopp ac136e
! 		&& !tv_check_lock(d->dv_lock, (char_u *)"remove() argument"))
Karsten Hopp ac136e
  	{
Karsten Hopp ac136e
  	    key = get_tv_string_chk(&argvars[1]);
Karsten Hopp ac136e
  	    if (key != NULL)
Karsten Hopp ac136e
***************
Karsten Hopp ac136e
*** 13270,13276 ****
Karsten Hopp ac136e
      else if (argvars[0].v_type != VAR_LIST)
Karsten Hopp ac136e
  	EMSG2(_(e_listdictarg), "remove()");
Karsten Hopp ac136e
      else if ((l = argvars[0].vval.v_list) != NULL
Karsten Hopp ac136e
! 	    && !tv_check_lock(l->lv_lock, (char_u *)"remove()"))
Karsten Hopp ac136e
      {
Karsten Hopp ac136e
  	int	    error = FALSE;
Karsten Hopp ac136e
  
Karsten Hopp ac136e
--- 13274,13280 ----
Karsten Hopp ac136e
      else if (argvars[0].v_type != VAR_LIST)
Karsten Hopp ac136e
  	EMSG2(_(e_listdictarg), "remove()");
Karsten Hopp ac136e
      else if ((l = argvars[0].vval.v_list) != NULL
Karsten Hopp ac136e
! 	    && !tv_check_lock(l->lv_lock, (char_u *)"remove() argument"))
Karsten Hopp ac136e
      {
Karsten Hopp ac136e
  	int	    error = FALSE;
Karsten Hopp ac136e
  
Karsten Hopp ac136e
***************
Karsten Hopp ac136e
*** 19693,19698 ****
Karsten Hopp ac136e
--- 19697,19703 ----
Karsten Hopp ac136e
      v->di_tv.vval.v_list = &fc.l_varlist;
Karsten Hopp ac136e
      vim_memset(&fc.l_varlist, 0, sizeof(list_T));
Karsten Hopp ac136e
      fc.l_varlist.lv_refcount = 99999;
Karsten Hopp ac136e
+     fc.l_varlist.lv_lock = VAR_FIXED;
Karsten Hopp ac136e
  
Karsten Hopp ac136e
      /*
Karsten Hopp ac136e
       * Set a:firstline to "firstline" and a:lastline to "lastline".
Karsten Hopp ac136e
*** ../vim-7.0.024/src/version.c	Thu Jun 22 17:33:49 2006
Karsten Hopp ac136e
--- src/version.c	Thu Jun 22 17:59:17 2006
Karsten Hopp ac136e
***************
Karsten Hopp ac136e
*** 668,669 ****
Karsten Hopp ac136e
--- 668,671 ----
Karsten Hopp ac136e
  {   /* Add new patch number below this line */
Karsten Hopp ac136e
+ /**/
Karsten Hopp ac136e
+     25,
Karsten Hopp ac136e
  /**/
Karsten Hopp ac136e
Karsten Hopp ac136e
-- 
Karsten Hopp ac136e
BRIDGEKEEPER: What is your favorite colour?
Karsten Hopp ac136e
GAWAIN:       Blue ...  No yelloooooww!
Karsten Hopp ac136e
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp ac136e
Karsten Hopp ac136e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp ac136e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp ac136e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp ac136e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///