diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-03-02 22:11:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-03-02 22:11:33 +0100 |
commit | caf6434ac937cf26050276d7b474be2d2d6a06b3 (patch) | |
tree | 8728fa627626f54449193af1359da6ec7f1c6e9e | |
parent | 66727e16079fbac6db3897b5c3736ec9fba995bb (diff) | |
download | vim-git-caf6434ac937cf26050276d7b474be2d2d6a06b3.tar.gz |
patch 8.0.0399: crash when using balloon_show() when not supportedv8.0.0399
Problem: Crash when using balloon_show() when not supported. (Hirohito
Higashi)
Solution: Check for balloonEval not to be NULL. (Ken Takata)
-rw-r--r-- | src/evalfunc.c | 3 | ||||
-rw-r--r-- | src/testdir/test_functions.vim | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 70b90ad17..20c5f8975 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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 diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 218567ff4..eeeb4e325 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -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 diff --git a/src/version.c b/src/version.c index c1f426cb3..5a10b4772 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 399, +/**/ 398, /**/ 397, |