From 217d285fddd80fb04b779b6e2888d57edb595f48 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 14 Sep 2010 12:47:37 +0200 Subject: 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) --- src/eval.c | 3 ++- src/testdir/Makefile | 2 +- src/testdir/test61.in | 4 ++++ src/version.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/eval.c b/src/eval.c index fc01006f2e..0f306d46ff 100644 --- 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 index 4951dc2fa1..bdc2c28cbd 100644 --- 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 index f9a1574616..88831636ae 100644 --- a/src/testdir/test61.in +++ b/src/testdir/test61.in @@ -3,6 +3,10 @@ Since this script is sourced we need to explicitly break changes up in undo-able pieces. Do that by setting 'undolevels'. Also tests :earlier and :later. +STARTTEST +:echo undotree().entries +ENDTEST + STARTTEST :" Delete three characters and undo Gx:set ul=100 diff --git a/src/version.c b/src/version.c index 3b50ffb95d..a1b3718c37 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 5, /**/ 4, /**/ -- cgit v1.2.3