mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.1223
Problem: Crash when setting v:errors to a number. Solution: Free the typval without assuming its type. (Yasuhiro Matsumoto)
This commit is contained in:
parent
e2c3810c2a
commit
a542c680a8
15
src/eval.c
15
src/eval.c
@ -919,6 +919,8 @@ eval_init(void)
|
|||||||
/* add to compat scope dict */
|
/* add to compat scope dict */
|
||||||
hash_add(&compat_hashtab, p->vv_di.di_key);
|
hash_add(&compat_hashtab, p->vv_di.di_key);
|
||||||
}
|
}
|
||||||
|
vimvars[VV_VERSION].vv_nr = VIM_VERSION_100;
|
||||||
|
|
||||||
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
|
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
|
||||||
set_vim_var_nr(VV_HLSEARCH, 1L);
|
set_vim_var_nr(VV_HLSEARCH, 1L);
|
||||||
set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc());
|
set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc());
|
||||||
@ -20616,11 +20618,8 @@ set_vim_var_string(
|
|||||||
char_u *val,
|
char_u *val,
|
||||||
int len) /* length of "val" to use or -1 (whole string) */
|
int len) /* length of "val" to use or -1 (whole string) */
|
||||||
{
|
{
|
||||||
/* Need to do this (at least) once, since we can't initialize a union.
|
clear_tv(&vimvars[idx].vv_di.di_tv);
|
||||||
* Will always be invoked when "v:progname" is set. */
|
vimvars[idx].vv_type = VAR_STRING;
|
||||||
vimvars[VV_VERSION].vv_nr = VIM_VERSION_100;
|
|
||||||
|
|
||||||
vim_free(vimvars[idx].vv_str);
|
|
||||||
if (val == NULL)
|
if (val == NULL)
|
||||||
vimvars[idx].vv_str = NULL;
|
vimvars[idx].vv_str = NULL;
|
||||||
else if (len == -1)
|
else if (len == -1)
|
||||||
@ -20635,7 +20634,8 @@ set_vim_var_string(
|
|||||||
void
|
void
|
||||||
set_vim_var_list(int idx, list_T *val)
|
set_vim_var_list(int idx, list_T *val)
|
||||||
{
|
{
|
||||||
list_unref(vimvars[idx].vv_list);
|
clear_tv(&vimvars[idx].vv_di.di_tv);
|
||||||
|
vimvars[idx].vv_type = VAR_LIST;
|
||||||
vimvars[idx].vv_list = val;
|
vimvars[idx].vv_list = val;
|
||||||
if (val != NULL)
|
if (val != NULL)
|
||||||
++val->lv_refcount;
|
++val->lv_refcount;
|
||||||
@ -20650,7 +20650,8 @@ set_vim_var_dict(int idx, dict_T *val)
|
|||||||
int todo;
|
int todo;
|
||||||
hashitem_T *hi;
|
hashitem_T *hi;
|
||||||
|
|
||||||
dict_unref(vimvars[idx].vv_dict);
|
clear_tv(&vimvars[idx].vv_di.di_tv);
|
||||||
|
vimvars[idx].vv_type = VAR_DICT;
|
||||||
vimvars[idx].vv_dict = val;
|
vimvars[idx].vv_dict = val;
|
||||||
if (val != NULL)
|
if (val != NULL)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,15 @@ func Test_assert_exception()
|
|||||||
endtry
|
endtry
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_wrong_error_type()
|
||||||
|
let save_verrors = v:errors
|
||||||
|
let v:['errors'] = {'foo': 3}
|
||||||
|
call assert_equal('yes', 'no')
|
||||||
|
let verrors = v:errors
|
||||||
|
let v:errors = save_verrors
|
||||||
|
call assert_equal(type([]), type(verrors))
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_user_is_happy()
|
func Test_user_is_happy()
|
||||||
smile
|
smile
|
||||||
sleep 300m
|
sleep 300m
|
||||||
|
@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1223,
|
||||||
/**/
|
/**/
|
||||||
1222,
|
1222,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user