]> granicus.if.org Git - vim/commitdiff
patch 8.0.0399: crash when using balloon_show() when not supported v8.0.0399
authorBram Moolenaar <Bram@vim.org>
Thu, 2 Mar 2017 21:11:33 +0000 (22:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 2 Mar 2017 21:11:33 +0000 (22:11 +0100)
Problem:    Crash when using balloon_show() when not supported. (Hirohito
            Higashi)
Solution:   Check for balloonEval not to be NULL. (Ken Takata)

src/evalfunc.c
src/testdir/test_functions.vim
src/version.c

index 70b90ad175355c082fe96e8fb625aa0dafe5fc5e..20c5f8975c92f1763658d8e22b6dfb14e84a40b9 100644 (file)
@@ -1375,7 +1375,8 @@ f_atan2(typval_T *argvars, typval_T *rettv)
     static void
 f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED)
 {
-    gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0]));
+    if (balloonEval != NULL)
+       gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0]));
 }
 #endif
 
index 218567ff46c8bb072b8c57e857d0af29b6ca5f3c..eeeb4e32532c0c5283ae93ab7e016761c5696d0d 100644 (file)
@@ -466,3 +466,8 @@ func Test_getbufvar()
 
   set fileformats&
 endfunc
+
+func Test_balloon_show()
+  " This won't do anything but must not crash either.
+  call balloon_show('hi!')
+endfunc
index c1f426cb3df20989f3529cbd2f1bda9984488f2c..5a10b4772a45ffea2b06641f05226519a50b3423 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    399,
 /**/
     398,
 /**/