patch 8.2.5089: some functions return a different value on failure
Problem: Some functions return a different value on failure.
Solution: Initialize the return value earlier. (Yegappan Lakshmanan,
closes #10568)
This commit is contained in:
committed by
Bram Moolenaar
parent
cd7496382e
commit
ca195cc84f
@ -1457,6 +1457,9 @@ dict_list(typval_T *argvars, typval_T *rettv, int what)
|
||||
dict_T *d;
|
||||
int todo;
|
||||
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
return;
|
||||
|
||||
if (in_vim9script() && check_for_dict_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
@ -1466,8 +1469,6 @@ dict_list(typval_T *argvars, typval_T *rettv, int what)
|
||||
return;
|
||||
}
|
||||
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
return;
|
||||
if ((d = argvars[0].vval.v_dict) == NULL)
|
||||
// empty dict behaves like an empty dict
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user