summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0349
blob: bf71803cbf02f7a723e05d4b5ca2adacea61d7f4 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0349
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0349
Problem:    Crash when wiping buffer in a callback.
Solution:   Do not handle messages when only peeking for a character.
            (closes #2107)  Add "redraw_flag" to test_override().
Files:	    src/os_unix.c, src/os_win32.c, src/screen.c, src/evalfunc.c,
            src/globals.h, runtime/doc/eval.txt


*** ../vim-8.1.0348/src/os_unix.c	2018-08-27 23:24:13.064009239 +0200
--- src/os_unix.c	2018-09-06 13:12:40.441556794 +0200
***************
*** 417,426 ****
  	    handle_resize();
  
  #ifdef MESSAGE_QUEUE
! 	parse_queued_messages();
! 	/* If input was put directly in typeahead buffer bail out here. */
! 	if (typebuf_changed(tb_change_cnt))
! 	    return 0;
  #endif
  	if (wtime < 0 && did_start_blocking)
  	    /* blocking and already waited for p_ut */
--- 417,430 ----
  	    handle_resize();
  
  #ifdef MESSAGE_QUEUE
! 	// Only process messages when waiting.
! 	if (wtime != 0)
! 	{
! 	    parse_queued_messages();
! 	    // If input was put directly in typeahead buffer bail out here.
! 	    if (typebuf_changed(tb_change_cnt))
! 		return 0;
! 	}
  #endif
  	if (wtime < 0 && did_start_blocking)
  	    /* blocking and already waited for p_ut */
*** ../vim-8.1.0348/src/os_win32.c	2018-08-30 17:47:01.949560920 +0200
--- src/os_win32.c	2018-09-06 12:12:22.506417572 +0200
***************
*** 1529,1543 ****
       */
      for (;;)
      {
  #ifdef MESSAGE_QUEUE
! 	parse_queued_messages();
  #endif
  #ifdef FEAT_MZSCHEME
! 	mzvim_check_threads();
  #endif
  #ifdef FEAT_CLIENTSERVER
! 	serverProcessPendingMessages();
  #endif
  
  	if (0
  #ifdef FEAT_MOUSE
--- 1529,1547 ----
       */
      for (;;)
      {
+ 	// Only process messages when waiting.
+ 	if (msec != 0)
+ 	{
  #ifdef MESSAGE_QUEUE
! 	    parse_queued_messages();
  #endif
  #ifdef FEAT_MZSCHEME
! 	    mzvim_check_threads();
  #endif
  #ifdef FEAT_CLIENTSERVER
! 	    serverProcessPendingMessages();
  #endif
+ 	}
  
  	if (0
  #ifdef FEAT_MOUSE
*** ../vim-8.1.0348/src/screen.c	2018-09-02 15:07:21.977655529 +0200
--- src/screen.c	2018-09-06 12:37:10.783837405 +0200
***************
*** 10819,10826 ****
  	return 0;
      else
  #endif
! 	return (!RedrawingDisabled
! 		       && !(p_lz && char_avail() && !KeyTyped && !do_redraw));
  }
  
  /*
--- 10819,10829 ----
  	return 0;
      else
  #endif
! 	return ((!RedrawingDisabled
! #ifdef FEAT_EVAL
! 		    || ignore_redraw_flag_for_testing
! #endif
! 		) && !(p_lz && char_avail() && !KeyTyped && !do_redraw));
  }
  
  /*
*** ../vim-8.1.0348/src/evalfunc.c	2018-09-02 14:25:02.330801508 +0200
--- src/evalfunc.c	2018-09-06 12:38:22.375337484 +0200
***************
*** 13073,13078 ****
--- 13073,13080 ----
  
  	if (STRCMP(name, (char_u *)"redraw") == 0)
  	    disable_redraw_for_testing = val;
+ 	else if (STRCMP(name, (char_u *)"redraw_flag") == 0)
+ 	    ignore_redraw_flag_for_testing = val;
  	else if (STRCMP(name, (char_u *)"char_avail") == 0)
  	    disable_char_avail_for_testing = val;
  	else if (STRCMP(name, (char_u *)"starting") == 0)
***************
*** 13095,13100 ****
--- 13097,13103 ----
  	{
  	    disable_char_avail_for_testing = FALSE;
  	    disable_redraw_for_testing = FALSE;
+ 	    ignore_redraw_flag_for_testing = FALSE;
  	    nfa_fail_for_testing = FALSE;
  	    if (save_starting >= 0)
  	    {
*** ../vim-8.1.0348/src/globals.h	2018-08-21 19:47:44.720053833 +0200
--- src/globals.h	2018-09-06 12:38:43.019189178 +0200
***************
*** 1633,1641 ****
  EXTERN int  alloc_fail_repeat INIT(= 0);
  
  /* flags set by test_override() */
! EXTERN int  disable_char_avail_for_testing INIT(= 0);
! EXTERN int  disable_redraw_for_testing INIT(= 0);
! EXTERN int  nfa_fail_for_testing INIT(= 0);
  
  EXTERN int  in_free_unref_items INIT(= FALSE);
  #endif
--- 1633,1642 ----
  EXTERN int  alloc_fail_repeat INIT(= 0);
  
  /* flags set by test_override() */
! EXTERN int  disable_char_avail_for_testing INIT(= FALSE);
! EXTERN int  disable_redraw_for_testing INIT(= FALSE);
! EXTERN int  ignore_redraw_flag_for_testing INIT(= FALSE);
! EXTERN int  nfa_fail_for_testing INIT(= FALSE);
  
  EXTERN int  in_free_unref_items INIT(= FALSE);
  #endif
*** ../vim-8.1.0348/runtime/doc/eval.txt	2018-09-02 15:18:38.906627880 +0200
--- runtime/doc/eval.txt	2018-09-06 12:34:54.793088505 +0200
***************
*** 8728,8733 ****
--- 8737,8743 ----
  
  		name	     effect when {val} is non-zero ~
  		redraw       disable the redrawing() function
+ 		redraw_flag  ignore the RedrawingDisabled flag
  		char_avail   disable the char_avail() function
  		starting     reset the "starting" variable, see below
  		nfa_fail     makes the NFA regexp engine fail to force a
*** ../vim-8.1.0348/src/version.c	2018-09-05 22:25:45.999112143 +0200
--- src/version.c	2018-09-06 12:36:05.184408056 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     349,
  /**/

-- 
Anyone who is capable of getting themselves made President should on no
account be allowed to do the job.
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// 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    ///