0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

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)
This commit is contained in:
Bram Moolenaar
2023-01-15 16:54:57 +00:00
parent 4cae845ce3
commit f450804e14
3 changed files with 25 additions and 1 deletions

View File

@@ -219,6 +219,27 @@ def Test_assignment_with_operator()
v9.CheckScriptSuccess(lines)
enddef
def Test_list_of_objects()
var lines =<< trim END
vim9script
class Foo
def Add()
enddef
endclass
def ProcessList(fooList: list<Foo>)
for foo in fooList
foo.Add()
endfor
enddef
var l: list<Foo> = [Foo.new()]
ProcessList(l)
END
v9.CheckScriptSuccess(lines)
enddef
def Test_class_default_new()
var lines =<< trim END
vim9script