patch 8.2.3771: Vim9: accessing freed memory when checking type
Problem: Vim9: accessing freed memory when checking type.
Solution: Make a copy of a function type.
diff --git a/src/structs.h b/src/structs.h
index be444e3..b8ffbe4 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1809,6 +1809,7 @@
char_u *sv_name; // points into "sn_all_vars" di_key
typval_T *sv_tv; // points into "sn_vars" or "sn_all_vars" di_tv
type_T *sv_type;
+ int sv_type_allocated; // call free_type() for sv_type
int sv_const; // 0, ASSIGN_CONST or ASSIGN_FINAL
int sv_export; // "export let var = val"
};