patch 9.1.1099: Vim9: import with extends may crash
Problem: Vim9: import with extends may crash, v9.1.1087 wasn't the
correct way to fix it)
Solution: When using an import class, Check for a valid class member
variable at compile time (Yegappan Lakshmanan)
related: #16601
closes: #16603
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 5022000..c7f0e67 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2461,14 +2461,8 @@
otv = class->class_members_tv;
}
- if (otv != NULL)
- {
- clear_tv(&otv[lidx]);
- otv[lidx] = *tv;
- }
- else
- status = FAIL;
-
+ clear_tv(&otv[lidx]);
+ otv[lidx] = *tv;
}
else
{