patch 9.1.0909: Vim9: crash when calling instance method

Problem:  Vim9: crash when calling instance method
          (Igbanam Ogbuluijah)
Solution: Pass the object when calling a partial function
          (Yegappan Lakshmanan)

fixes: #16166
closes: #16180

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2024-12-06 18:35:12 +01:00
committed by Christian Brabandt
parent 51d4d84d6a
commit 481992cea9
3 changed files with 66 additions and 1 deletions

View File

@ -271,8 +271,10 @@ eval_expr_partial(
return FAIL;
// Shortcut to call a compiled function with minimal overhead.
if (partial->pt_obj != NULL)
partial->pt_obj->obj_refcount++;
r = call_def_function(partial->pt_func, argc, argv, DEF_USE_PT_ARGV,
partial, NULL, fc, rettv);
partial, partial->pt_obj, fc, rettv);
if (fc_arg == NULL)
remove_funccal();
if (r == FAIL)