0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.1.0385: Vim9: crash with null_class and null_object

Problem:  Vim9: crash with null_class and null_object
          (Aliaksei Budavei)
Solution: Handle null_class and null_object correctly
          (Yegappan Lakshmanan)

fixes: #14678
closes: #14681

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2024-05-01 11:44:17 +02:00
committed by Christian Brabandt
parent ca4b81a7ae
commit b2e42b9be0
5 changed files with 67 additions and 10 deletions

View File

@@ -6403,9 +6403,9 @@ echo_string_core(
{
class_T *cl = tv->vval.v_class;
char *s = "class";
if (IS_INTERFACE(cl))
if (cl && IS_INTERFACE(cl))
s = "interface";
else if (IS_ENUM(cl))
else if (cl && IS_ENUM(cl))
s = "enum";
size_t len = STRLEN(s) + 1 +
(cl == NULL ? 9 : STRLEN(cl->class_name)) + 1;