diff options
author | ckelsel <ckelsel@hotmail.com> | 2017-07-21 20:25:36 +0800 |
---|---|---|
committer | ckelsel <ckelsel@hotmail.com> | 2017-07-21 20:25:36 +0800 |
commit | 2c89195afdce9c66c875801753523f561ed5e4ca (patch) | |
tree | 9945e93e7ebca2387221b6a11670f100000a0124 /src/nvim/eval.c | |
parent | cb95f71f71f665b21848cf25780d83278cd1dcf0 (diff) | |
parent | 4bcc70b2b5b02e3a6048b55a4390739570db3524 (diff) | |
download | rneovim-2c89195afdce9c66c875801753523f561ed5e4ca.tar.gz rneovim-2c89195afdce9c66c875801753523f561ed5e4ca.tar.bz2 rneovim-2c89195afdce9c66c875801753523f561ed5e4ca.zip |
merge upstream
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index e5bb7f1b38..08b3d1dbd7 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4239,11 +4239,17 @@ static int eval7( // use its contents. s = deref_func_name((const char *)s, &len, &partial, !evaluate); + // Need to make a copy, in case evaluating the arguments makes + // the name invalid. + s = xmemdupz(s, len); + // Invoke the function. ret = get_func_tv(s, len, rettv, arg, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &len, evaluate, partial, NULL); + xfree(s); + // If evaluate is false rettv->v_type was not set in // get_func_tv, but it's needed in handle_subscript() to parse // what follows. So set it here. |