Hi Dominique,

2015-7-18(Sat) 14:40:28 UTC+9 Dominique Pelle:
> h_east wrote:
> 
> > Hi Dominique!
> >
> > 2015-7-18(Sat) 9:38:45 UTC+9 Dominique Pelle:
> >> Bram Moolenaar <[email protected]> wrote:
> >>
> >> > Patch 7.4.786
> >> > Problem:    It is not possible for a plugin to adjust to a changed 
> >> > setting.
> >> > Solution:   Add the OptionSet autocommand event. (Christian Brabandt)
> >>
> >> Hi
> >>
> >> This patch causes use of freed memory when running test10.
> >>
> >> changeset 6935:4db70c94226b -> crash in test 10 with asan
> >> changeset 6934:be7bd53ad376 -> no crash
> 
> ....snip...
> 
> > Could you try attached patch?
> >
> > --
> > Best regards,
> > Hirohito Higashi (a.k.a h_east)
> 
> Hi Hirohito
> 
> test10 still crashes after your patch, but the stack is then
> different after your patch:
..snip..

Thanks for confirming my patch!
# My environment does not crash in original 7.4.786. (fedora 20 64bit)

I update a patch.
Attached new patch and valgrind.test10.

valgrind.test10 seem to say that it error yet...
Excuse me. Could you try again this patch?

Thanks.
--
Best regards,
Hirohito Higashi (a.k.a h_east)

-- 
-- 
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.
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -4943,7 +4943,8 @@
 
 			    sprintf((char *)buf_type, "%s",
 				(opt_flags & OPT_LOCAL) ? "local" : "global");
-			    set_vim_var_string(VV_OPTION_NEW, newval, -1);
+			    set_vim_var_string(VV_OPTION_NEW,
+							*(char_u **)varp, -1);
 			    set_vim_var_string(VV_OPTION_OLD, saved_origval, -1);
 			    set_vim_var_string(VV_OPTION_TYPE, buf_type, -1);
 			    apply_autocmds(EVENT_OPTIONSET,
@@ -5739,7 +5740,7 @@
 	    sprintf((char *)buf_type, "%s",
 		(opt_flags & OPT_LOCAL) ? "local" : "global");
 	    set_vim_var_string(VV_OPTION_NEW, s, -1);
-	    set_vim_var_string(VV_OPTION_OLD, oldval, -1);
+	    set_vim_var_string(VV_OPTION_OLD, saved_oldval, -1);
 	    set_vim_var_string(VV_OPTION_TYPE, buf_type, -1);
 	    apply_autocmds(EVENT_OPTIONSET, (char_u *)options[opt_idx].fullname, NULL, FALSE, NULL);
 	    reset_v_option_vars();
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -9,7 +9,7 @@
 #   The output goes into a file "valgrind.testN"
 #   Vim should be compiled with EXITFREE to avoid false warnings.
 #   This will make testing about 10 times as slow.
-# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$*
+VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$*
 
 
 SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \

Attachment: valgrind.test10
Description: Binary data

Raspunde prin e-mail lui