mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
eval: fix assertion failure in garbage collection (#12436)
* eval: fix assertion failure in garbage collection fixes #12387, #12430 Lists with CopyID+1 linked only from previous_funccal may be removed in the garbage collection. Therefore, the terms of the assertions are not correct. This can be confirmed by the following (The l:x with CopyID+1 of the first function call needs to be removed by garbage collection): func! s:f() let l:x = [1] let g:x = l: endfunc for _ in range(2) call s:f() endfor call garbagecollect() " press any key * test: add test for #12387, #12430
This commit is contained in:
@@ -364,7 +364,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
||||
_TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(tv->vval.v_list, lv_copyID, copyID,
|
||||
kMPConvList);
|
||||
TYPVAL_ENCODE_CONV_LIST_START(tv, tv_list_len(tv->vval.v_list));
|
||||
assert(saved_copyID != copyID && saved_copyID != copyID - 1);
|
||||
assert(saved_copyID != copyID);
|
||||
_mp_push(*mpstack, ((MPConvStackVal) {
|
||||
.type = kMPConvList,
|
||||
.tv = tv,
|
||||
|
Reference in New Issue
Block a user