Mercurial > vim
comparison src/list.c @ 24160:e695db9a5465 v8.2.2621
patch 8.2.2621: typval2type() cannot handle recursive structures
Commit: https://github.com/vim/vim/commit/108cf0153c5770e343aec9e2390acdaa4a0b149a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 18 22:15:04 2021 +0100
patch 8.2.2621: typval2type() cannot handle recursive structures
Problem: typval2type() cannot handle recursive structures.
Solution: Use copyID. (closes https://github.com/vim/vim/issues/7979)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 18 Mar 2021 22:30:03 +0100 |
parents | 06da0685077b |
children | d406858354a6 |
comparison
equal
deleted
inserted
replaced
24159:f2c1bf894535 | 24160:e695db9a5465 |
---|---|
2050 copy_tv(&argvars[0], rettv); | 2050 copy_tv(&argvars[0], rettv); |
2051 if (filtermap == FILTERMAP_MAP && in_vim9script()) | 2051 if (filtermap == FILTERMAP_MAP && in_vim9script()) |
2052 { | 2052 { |
2053 // Check that map() does not change the type of the dict. | 2053 // Check that map() does not change the type of the dict. |
2054 ga_init2(&type_list, sizeof(type_T *), 10); | 2054 ga_init2(&type_list, sizeof(type_T *), 10); |
2055 type = typval2type(argvars, &type_list); | 2055 type = typval2type(argvars, get_copyID(), &type_list); |
2056 } | 2056 } |
2057 | 2057 |
2058 if (argvars[0].v_type == VAR_BLOB) | 2058 if (argvars[0].v_type == VAR_BLOB) |
2059 { | 2059 { |
2060 if (filtermap == FILTERMAP_MAPNEW) | 2060 if (filtermap == FILTERMAP_MAPNEW) |
2556 | 2556 |
2557 if (!is_new && in_vim9script()) | 2557 if (!is_new && in_vim9script()) |
2558 { | 2558 { |
2559 // Check that map() does not change the type of the dict. | 2559 // Check that map() does not change the type of the dict. |
2560 ga_init2(&type_list, sizeof(type_T *), 10); | 2560 ga_init2(&type_list, sizeof(type_T *), 10); |
2561 type = typval2type(argvars, &type_list); | 2561 type = typval2type(argvars, get_copyID(), &type_list); |
2562 } | 2562 } |
2563 | 2563 |
2564 if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) | 2564 if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) |
2565 { | 2565 { |
2566 list_T *l1, *l2; | 2566 list_T *l1, *l2; |