summaryrefslogtreecommitdiffstats
path: root/src/vim9instr.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-08 19:43:55 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-08 19:43:55 +0000
commited0c62e7b16b62655824df28cdd6bd75aadbb8fc (patch)
tree2d912c33146a6ddd65d7877ac8cc9339c9fb953f /src/vim9instr.c
parent673bcb10ebe87ccf6954dd342d0143eb88cdfbcb (diff)
patch 8.2.4529: Vim9: comparing partial with function failsv8.2.4529
Problem: Vim9: comparing partial with function fails. Solution: Support this comparison. Avoid a crash. (closes #9909) Add more test cases.
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r--src/vim9instr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 7fbf529a64..e36ea16e2e 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -370,7 +370,9 @@ get_compare_isn(exprtype_T exprtype, vartype_T type1, vartype_T type2)
}
else if (type1 == VAR_ANY || type2 == VAR_ANY
|| ((type1 == VAR_NUMBER || type1 == VAR_FLOAT)
- && (type2 == VAR_NUMBER || type2 == VAR_FLOAT)))
+ && (type2 == VAR_NUMBER || type2 == VAR_FLOAT))
+ || (type1 == VAR_FUNC && type2 == VAR_PARTIAL)
+ || (type1 == VAR_PARTIAL && type2 == VAR_FUNC))
isntype = ISN_COMPAREANY;
else if (type1 == VAR_SPECIAL || type2 == VAR_SPECIAL)
{