vim-patch:7.4.513

Problem:    Crash because reference count is wrong for list returned by
	    getreg().
Solution:   Increment the reference count. (Kimmy Lindvall)

https://code.google.com/p/vim/source/detail?r=v7-4-513
This commit is contained in:
Florian Walch 2014-12-23 21:37:19 +01:00
parent 89bab9b90e
commit 5e542ba56e
2 changed files with 4 additions and 1 deletions

View File

@ -9553,6 +9553,9 @@ static void f_getreg(typval_T *argvars, typval_T *rettv)
rettv->v_type = VAR_LIST;
rettv->vval.v_list =
get_reg_contents(regname, (arg2 ? kGRegExprSrc : 0) | kGRegList);
if (rettv->vval.v_list != NULL) {
rettv->vval.v_list->lv_refcount++;
}
} else {
rettv->v_type = VAR_STRING;
rettv->vval.v_string = get_reg_contents(regname, arg2 ? kGRegExprSrc : 0);

View File

@ -225,7 +225,7 @@ static int included_patches[] = {
//516,
//515,
//514,
//513,
513,
//512 NA
//511 NA
//510 NA