0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -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

@@ -1823,6 +1823,8 @@ compile_lhs(
class_T *cl = (class_T *)lhs->lhs_type->tt_member;
lhs->lhs_member_type = class_member_type(cl, after + 1,
lhs->lhs_end, &lhs->lhs_member_idx);
if (lhs->lhs_member_idx < 0)
return FAIL;
}
else
lhs->lhs_member_type = lhs->lhs_type->tt_member;