summaryrefslogtreecommitdiffstats
path: root/vim/vim-7.2/7.2.192
blob: 28cefd5bb9971d664cb66b044b2c4de3b90b2164 (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
To: vim-dev@vim.org
Subject: Patch 7.2.192
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.2.192 (after 7.2.188)
Problem:    Still a crash in the garbage collector for a very rare situation.
Solution:   Make sure current_copyID is always incremented correctly. (Kent
	    Sibilev)
Files:	    src/eval.c


*** ../vim-7.2.191/src/eval.c	2009-05-26 22:58:43.000000000 +0200
--- src/eval.c	2009-05-29 21:13:47.000000000 +0200
***************
*** 6526,6532 ****
  
      /* Don't free variables in the previous_funccal list unless they are only
       * referenced through previous_funccal.  This must be first, because if
!      * the item is referenced elsewhere it must not be freed. */
      for (fc = previous_funccal; fc != NULL; fc = fc->caller)
      {
  	set_ref_in_ht(&fc->l_vars.dv_hashtab, copyID + 1);
--- 6526,6532 ----
  
      /* Don't free variables in the previous_funccal list unless they are only
       * referenced through previous_funccal.  This must be first, because if
!      * the item is referenced elsewhere the funccal must not be freed. */
      for (fc = previous_funccal; fc != NULL; fc = fc->caller)
      {
  	set_ref_in_ht(&fc->l_vars.dv_hashtab, copyID + 1);
***************
*** 6564,6573 ****
      /* v: vars */
      set_ref_in_ht(&vimvarht, copyID);
  
!     /* Free lists and dictionaries that are not referenced. */
      did_free = free_unref_items(copyID);
  
!     /* check if any funccal can be freed now */
      for (pfc = &previous_funccal; *pfc != NULL; )
      {
  	if (can_free_funccal(*pfc, copyID))
--- 6564,6577 ----
      /* v: vars */
      set_ref_in_ht(&vimvarht, copyID);
  
!     /*
!      * 2. Free lists and dictionaries that are not referenced.
!      */
      did_free = free_unref_items(copyID);
  
!     /*
!      * 3. Check if any funccal can be freed now.
!      */
      for (pfc = &previous_funccal; *pfc != NULL; )
      {
  	if (can_free_funccal(*pfc, copyID))
***************
*** 9286,9292 ****
      if (noref < 0 || noref > 1)
  	EMSG(_(e_invarg));
      else
! 	item_copy(&argvars[0], rettv, TRUE, noref == 0 ? ++current_copyID : 0);
  }
  
  /*
--- 9290,9299 ----
      if (noref < 0 || noref > 1)
  	EMSG(_(e_invarg));
      else
!     {
! 	current_copyID += COPYID_INC;
! 	item_copy(&argvars[0], rettv, TRUE, noref == 0 ? current_copyID : 0);
!     }
  }
  
  /*
***************
*** 18966,18972 ****
      char_u	*s;
      char_u	numbuf[NUMBUFLEN];
  
!     s = echo_string(&v->di_tv, &tofree, numbuf, ++current_copyID);
      list_one_var_a(prefix, v->di_key, v->di_tv.v_type,
  					 s == NULL ? (char_u *)"" : s, first);
      vim_free(tofree);
--- 18973,18980 ----
      char_u	*s;
      char_u	numbuf[NUMBUFLEN];
  
!     current_copyID += COPYID_INC;
!     s = echo_string(&v->di_tv, &tofree, numbuf, current_copyID);
      list_one_var_a(prefix, v->di_key, v->di_tv.v_type,
  					 s == NULL ? (char_u *)"" : s, first);
      vim_free(tofree);
***************
*** 19401,19407 ****
  	    }
  	    else if (eap->cmdidx == CMD_echo)
  		msg_puts_attr((char_u *)" ", echo_attr);
! 	    p = echo_string(&rettv, &tofree, numbuf, ++current_copyID);
  	    if (p != NULL)
  		for ( ; *p != NUL && !got_int; ++p)
  		{
--- 19409,19416 ----
  	    }
  	    else if (eap->cmdidx == CMD_echo)
  		msg_puts_attr((char_u *)" ", echo_attr);
! 	    current_copyID += COPYID_INC;
! 	    p = echo_string(&rettv, &tofree, numbuf, current_copyID);
  	    if (p != NULL)
  		for ( ; *p != NUL && !got_int; ++p)
  		{
*** ../vim-7.2.191/src/version.c	2009-05-26 22:58:43.000000000 +0200
--- src/version.c	2009-06-03 13:21:20.000000000 +0200
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     192,
  /**/

-- 
Imagine a world without hypothetical situations.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///