diff options
author | erw7 <erw7.github@gmail.com> | 2020-06-22 23:17:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 10:17:20 -0400 |
commit | 21453e8f09b72751d396858b9ea86c0584fd6c89 (patch) | |
tree | 38273aab781fe6542592439d5a4339c1e61911fe /src/nvim/eval/typval_encode.c.h | |
parent | 4496628c181e456d57e9257e14d8582d8dc548eb (diff) | |
download | rneovim-21453e8f09b72751d396858b9ea86c0584fd6c89.tar.gz rneovim-21453e8f09b72751d396858b9ea86c0584fd6c89.tar.bz2 rneovim-21453e8f09b72751d396858b9ea86c0584fd6c89.zip |
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
Diffstat (limited to 'src/nvim/eval/typval_encode.c.h')
-rw-r--r-- | src/nvim/eval/typval_encode.c.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h index 0aa64b1d5f..91c948ce7e 100644 --- a/src/nvim/eval/typval_encode.c.h +++ b/src/nvim/eval/typval_encode.c.h @@ -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, |