patch 9.0.1375: crash when getting member of obj of unknown class
Problem: Crash when getting member of obj of unknown class.
Solution: Check for NULL class and give an error message. (Ernie Rael,
closes #12096)
diff --git a/src/vim9expr.c b/src/vim9expr.c
index b8458aa..d600cb0 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -293,6 +293,13 @@
}
}
+ if (cl == NULL)
+ {
+ // TODO: this should not give an error but be handled at runtime
+ emsg(_(e_incomplete_type));
+ return FAIL;
+ }
+
++*arg;
char_u *name = *arg;
char_u *name_end = find_name_end(name, NULL, NULL, FNE_CHECK_START);