Hi,

2017/3/2 Thu 11:52:29 UTC+9 h_east wrote:
> Hi Bram,
> 
> How to reproduce (on Linux):
> - Go to Vim source directory
>   $ cd /path/to/your/vim
> - Configure with enabling gui gnome2
>   $ ./configure --with-features=huge --enable-gui=gnome2 
> --enable-fail-if-missing
> - Make
>   $ make
> - Run vanilla CLI Vim
>   $ src/vim -Nu NONE
> - Execute the following command.
>   :call balloon_show("Hi")
> 
> Expected behavior:
> - Nothing happens. (Or an error message is output?)
> 
> Actual behavior:
> - SEGV
> 
> Attached patch fixes this.

Isn't it better to add NULL check to the caller of gui_mch_post_balloon()?
Because other part do so.

Additionally, I found some problems in the document.

1. Tabs and spaces are mixed.
2. '+beval' should be '|+balloon_eval|'.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent  7607a95e2dfa5a9b4fbe14488f7d34605dd3e402

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2623,8 +2623,8 @@ atan2({expr1}, {expr2})					*atan2()*
 		{only available when compiled with the |+float| feature}
 
 balloon_show({msg})                                     *balloon_show()*
-                Show {msg} inside the balloon.
-                Example: >
+		Show {msg} inside the balloon.
+		Example: >
 			func GetBalloonContent()
 			   " initiate getting the content
 			   return ''
@@ -2632,7 +2632,7 @@ balloon_show({msg})                     
 			set balloonexpr=GetBalloonContent()
 
 			func BalloonCallback(result)
-                          call balloon_show(a:result)
+			  call balloon_show(a:result)
 			endfunc
 <
 		The intended use is that fetching the content of the balloon
@@ -2640,7 +2640,8 @@ balloon_show({msg})                     
 		asynchronous method, in which a callback invokes
 		balloon_show().  The 'balloonexpr' itself can return an
 		empty string or a placeholder.
-                {only available when compiled with the +beval feature}
+		{only available when compiled with the |+balloon_eval|
+		feature}
 
 							*browse()*
 browse({save}, {title}, {initdir}, {default})
diff --git a/src/evalfunc.c b/src/evalfunc.c
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1377,7 +1377,8 @@ f_atan2(typval_T *argvars, typval_T *ret
     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
 

Raspunde prin e-mail lui