patch 9.1.1087: Vim9: import with extends may crash
Problem: Vim9: import with extends may crash
Solution: check otv for being NULL before trying to access it
(Hirohito Higashi)
closes: #16601
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9execute.c b/src/vim9execute.c
index c7f0e67..5022000 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2461,8 +2461,14 @@
otv = class->class_members_tv;
}
- clear_tv(&otv[lidx]);
- otv[lidx] = *tv;
+ if (otv != NULL)
+ {
+ clear_tv(&otv[lidx]);
+ otv[lidx] = *tv;
+ }
+ else
+ status = FAIL;
+
}
else
{