Skip to content

Commit caf6434

Browse files
committed
patch 8.0.0399: crash when using balloon_show() when not supported
Problem: Crash when using balloon_show() when not supported. (Hirohito Higashi) Solution: Check for balloonEval not to be NULL. (Ken Takata)
1 parent 66727e1 commit caf6434

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/evalfunc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,8 @@ f_atan2(typval_T *argvars, typval_T *rettv)
13751375
static void
13761376
f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED)
13771377
{
1378-
gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0]));
1378+
if (balloonEval != NULL)
1379+
gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0]));
13791380
}
13801381
#endif
13811382

src/testdir/test_functions.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,3 +466,8 @@ func Test_getbufvar()
466466

467467
set fileformats&
468468
endfunc
469+
470+
func Test_balloon_show()
471+
" This won't do anything but must not crash either.
472+
call balloon_show('hi!')
473+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
399,
767769
/**/
768770
398,
769771
/**/

0 commit comments

Comments
 (0)