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.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 44403ec..9105dcf 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1823,6 +1823,8 @@
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;