mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.1580
Problem: Crash when using function reference. (Luchr)
Solution: Set initial refcount. (Ken Takata)
7a5c46a9df
This commit is contained in:
parent
529482d684
commit
2c1b4c7f3c
@ -18340,6 +18340,7 @@ handle_subscript (
|
|||||||
|
|
||||||
// Turn "dict.Func" into a partial for "Func" with "dict".
|
// Turn "dict.Func" into a partial for "Func" with "dict".
|
||||||
if (pt != NULL) {
|
if (pt != NULL) {
|
||||||
|
pt->pt_refcount = 1;
|
||||||
pt->pt_dict = selfdict;
|
pt->pt_dict = selfdict;
|
||||||
selfdict = NULL;
|
selfdict = NULL;
|
||||||
pt->pt_name = rettv->vval.v_string;
|
pt->pt_name = rettv->vval.v_string;
|
||||||
|
@ -67,3 +67,17 @@ func Test_partial_implicit()
|
|||||||
|
|
||||||
call assert_fails('call function(dict.MyFunc, ["bbb"], dict)', 'E924:')
|
call assert_fails('call function(dict.MyFunc, ["bbb"], dict)', 'E924:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
fun InnerCall(funcref)
|
||||||
|
return a:funcref
|
||||||
|
endfu
|
||||||
|
|
||||||
|
fun OuterCall()
|
||||||
|
let opt = { 'func' : function('sin') }
|
||||||
|
call InnerCall(opt.func)
|
||||||
|
endfu
|
||||||
|
|
||||||
|
func Test_function_in_dict()
|
||||||
|
call OuterCall()
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
@ -862,7 +862,7 @@ static int included_patches[] = {
|
|||||||
// 1583 NA
|
// 1583 NA
|
||||||
// 1582,
|
// 1582,
|
||||||
// 1581,
|
// 1581,
|
||||||
// 1580,
|
1580,
|
||||||
// 1579 NA
|
// 1579 NA
|
||||||
1578,
|
1578,
|
||||||
1577,
|
1577,
|
||||||
|
Loading…
Reference in New Issue
Block a user