Mercurial > vim
diff src/structs.h @ 33503:f72004b37b2b v9.0.2001
patch 9.0.2001: Vim9: segfault with islocked()
Commit: https://github.com/vim/vim/commit/9771b2a67f825bdc6e5c615141d22c665952dc86
Author: Ernie Rael <errael@raelity.com>
Date: Sat Oct 7 22:05:40 2023 +0200
patch 9.0.2001: Vim9: segfault with islocked()
Problem: Vim9: segfault with islocked()
Solution: Check that the lval pointer is not null for objects and
class variables
closes: #13295
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 07 Oct 2023 22:15:09 +0200 |
parents | 4a62e78803db |
children | 1f9b1def80c8 |
line wrap: on
line diff
--- a/src/structs.h +++ b/src/structs.h @@ -4547,11 +4547,18 @@ typedef struct * "tv" points to the (first) list item value * "li" points to the (first) list item * "range", "n1", "n2" and "empty2" indicate what items are used. - * For a member in a class/object: TODO: verify fields + * For a plain class or object: + * "name" points to the variable name. + * "exp_name" is NULL. + * "tv" points to the variable + * "is_root" TRUE + * For a variable in a class/object: (class is not NULL) * "name" points to the (expanded) variable name. * "exp_name" NULL or non-NULL, to be freed later. - * "tv" points to the (first) list item value - * "oi" index into member array, see _type to determine which array + * "tv" May point to class/object variable. + * "object" object containing variable, NULL if class variable + * "class" class of object or class containing variable + * "oi" index into class/object of tv * For an existing Dict item: * "name" points to the (expanded) variable name. * "exp_name" NULL or non-NULL, to be freed later. @@ -4591,8 +4598,8 @@ typedef struct lval_S object_T *ll_object; // The object or NULL, class is not NULL class_T *ll_class; // The class or NULL, object may be NULL int ll_oi; // The object/class member index - int ll_is_root; // Special case. ll_tv is lval_root, - // ignore the rest. + int ll_is_root; // TRUE if ll_tv is the lval_root, like a + // plain object/class. ll_tv is variable. } lval_T; /**