# HG changeset patch # User Bram Moolenaar # Date 1284461257 -7200 # Node ID 1c00ea3641a8a1e58e70cd51ab831003bdb41d50 # Parent 766918de9e3a76816ebdee3b90cdb1f9f76bca6a updated for version 7.3.005 Problem: Crash when using undotree(). (Christian Brabandt) Solution: Increase the list reference count. Add a test for undotree() (Lech Lorens) diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -7075,7 +7075,7 @@ dict_add_nr_str(d, key, nr, str) } /* - * Add a list entry to dictionary "d". + * Add a list entry to dictionary "d". * Returns FAIL when out of memory and when key already exists. */ int @@ -7097,6 +7097,7 @@ dict_add_list(d, key, list) dictitem_free(item); return FAIL; } + ++list->lv_refcount; return OK; } diff --git a/src/testdir/Makefile b/src/testdir/Makefile --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -44,7 +44,7 @@ report: $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) clean: - -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo + -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.* viminfo test1.out: test1.in -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo diff --git a/src/testdir/test61.in b/src/testdir/test61.in --- a/src/testdir/test61.in +++ b/src/testdir/test61.in @@ -4,6 +4,10 @@ undo-able pieces. Do that by setting 'u Also tests :earlier and :later. STARTTEST +:echo undotree().entries +ENDTEST + +STARTTEST :" Delete three characters and undo Gx:set ul=100 x:set ul=100 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 5, +/**/ 4, /**/ 3,