Mercurial > vim
diff src/testdir/test_filter_map.vim @ 17936:7f3283683d97 v8.1.1964
patch 8.1.1964: crash when using nested map() and filter()
Commit: https://github.com/vim/vim/commit/c36350bca3eed8ef97061e28c38b5b89cae1f13e
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 2 20:44:07 2019 +0200
patch 8.1.1964: crash when using nested map() and filter()
Problem: Crash when using nested map() and filter().
Solution: Do not set the v:key type to string without clearing the pointer.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 02 Sep 2019 20:45:04 +0200 |
parents | 051937ebaf22 |
children | 745c02392844 |
line wrap: on
line diff
--- a/src/testdir/test_filter_map.vim +++ b/src/testdir/test_filter_map.vim @@ -53,6 +53,12 @@ func Test_filter_map_list_expr_funcref() call assert_equal([0, 2, 4, 6], map([1, 2, 3, 4], function('s:filter4'))) endfunc +func Test_filter_map_nested() + let x = {"x":10} + let r = map(range(2), 'filter(copy(x), "1")') + call assert_equal([x, x], r) +endfunc + " dict with funcref func Test_filter_map_dict_expr_funcref() let dict = {"foo": 1, "bar": 2, "baz": 3}