patch 9.0.1862: Vim9 Garbage Collection issues
Problem: Vim9 Garbage Collection issues
Solution: Class members are garbage collected early leading to
use-after-free problems. Handle the garbage
collection of classes properly.
closes: #13019
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
diff --git a/src/structs.h b/src/structs.h
index 6e9e901..7acd857 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1525,6 +1525,8 @@
int class_refcount;
int class_copyID; // used by garbage collection
+ class_T *class_next_used; // for list headed by "first_class"
+ class_T *class_prev_used; // for list headed by "first_class"
class_T *class_extends; // parent class or NULL