0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.1035: object members are not being marked as used

Problem:    Object members are not being marked as used, garbage collection
            may free them.
Solution:   Mark object members as used.  Fix reference counting.
This commit is contained in:
Bram Moolenaar
2022-12-08 20:42:00 +00:00
parent e5eae82bb7
commit d28d7b94f5
8 changed files with 288 additions and 158 deletions

View File

@@ -1487,8 +1487,13 @@ struct class_S
// Used for v_object of typval of VAR_OBJECT.
// The member variables follow in an array of typval_T.
struct object_S {
class_T *obj_class; // class this object is created for
class_T *obj_class; // class this object is created for;
// pointer adds to class_refcount
int obj_refcount;
object_T *obj_next_used; // for list headed by "first_object"
object_T *obj_prev_used; // for list headed by "first_object"
int obj_copyID; // used by garbage collection
};
#define TTFLAG_VARARGS 0x01 // func args ends with "..."