I've applied the following patch to pum_redraw function to avoid rare segfaults 
I was suffering.

diff -r 92c9748e0ccb src/popupmnu.c
--- a/src/popupmnu.c    Sun Oct 06 17:46:56 2013 +0200
+++ b/src/popupmnu.c    Mon Oct 21 12:29:31 2013 -0200
@@ -295,6 +295,8 @@
     for (i = 0; i < pum_height; ++i)
     {
        idx = i + pum_first;
+       if(idx >= pum_height)
+           break;
        attr = (idx == pum_selected) ? attr_select : attr_norm;
 
        /* prepend a space if there is room */

I've discovered the situation while debugging 
https://github.com/Valloric/YouCompleteMe/issues/593 but I'm unable to explain 
all the characteristics that leads to the segfault situation (that happens only 
occasionally). I just verified that idx was getting beyond pum_height in the 
last step of the loop, and this was a problem when accessing pum_array[idx], 
for example, referencing invalid memory.

-- 
-- 
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/groups/opt_out.
diff -r 92c9748e0ccb src/popupmnu.c
--- a/src/popupmnu.c	Sun Oct 06 17:46:56 2013 +0200
+++ b/src/popupmnu.c	Mon Oct 21 12:29:31 2013 -0200
@@ -295,6 +295,8 @@
     for (i = 0; i < pum_height; ++i)
     {
 	idx = i + pum_first;
+	if(idx >= pum_height)
+	    break;
 	attr = (idx == pum_selected) ? attr_select : attr_norm;
 
 	/* prepend a space if there is room */

Raspunde prin e-mail lui