0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.1091: assignment to non-existing member causes a crash

Problem:    Assignment to non-existing member causes a crash. (Yegappan
            Lakshmanan)
Solution:   Give an error message and bail out when a member cannot be found.
This commit is contained in:
Bram Moolenaar
2022-12-23 17:56:27 +00:00
parent c9207d5d79
commit f54cedd676
4 changed files with 22 additions and 2 deletions

View File

@@ -569,8 +569,9 @@ cleanup:
}
/*
* Find member "name" in class "cl" and return its type.
* When not found t_any is returned.
* Find member "name" in class "cl", set "member_idx" to the member index and
* return its type.
* When not found "member_idx" is set to -1 and t_any is returned.
*/
type_T *
class_member_type(
@@ -591,6 +592,8 @@ class_member_type(
return m->ocm_type;
}
}
semsg(_(e_unknown_variable_str), name);
return &t_any;
}