diff src/vim9type.c @ 31740:22a4824d7964 v9.0.1202

patch 9.0.1202: crash when iterating over list of objects Commit: https://github.com/vim/vim/commit/f450804e1438307c79a62053f8c32eef1508383a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 15 16:54:57 2023 +0000 patch 9.0.1202: crash when iterating over list of objects Problem: Crash when iterating over list of objects. Solution: Do not make a copy of tt_member for object or class. (closes #11823)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Jan 2023 18:00:03 +0100
parents 50241d494268
children f578bef02249
line wrap: on
line diff
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -86,7 +86,8 @@ copy_type_deep_rec(type_T *type, garray_
     ((type_T **)seen_types->ga_data)[seen_types->ga_len * 2 + 1] = copy;
     ++seen_types->ga_len;
 
-    if (copy->tt_member != NULL)
+    if (copy->tt_member != NULL
+	    && copy->tt_type != VAR_OBJECT && copy->tt_type != VAR_CLASS)
 	copy->tt_member = copy_type_deep_rec(copy->tt_member,
 							 type_gap, seen_types);