Mercurial > vim
comparison src/eval.c @ 26560:454a1c9ef797 v8.2.3809
patch 8.2.3809: Vim9: crash when garbage collecting a nested partial
Commit: https://github.com/vim/vim/commit/7509ad8b0fad56f88288977decbeca3640406c82
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 14 18:14:37 2021 +0000
patch 8.2.3809: Vim9: crash when garbage collecting a nested partial
Problem: Vim9: crash when garbage collecting a nested partial. (Virginia
Senioria)
Solution: Set references in all the funcstacks. (closes #9348)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Dec 2021 19:15:04 +0100 |
parents | dff04b7fa6b2 |
children | 479022b3e7bd |
comparison
equal
deleted
inserted
replaced
26559:177872ca0db9 | 26560:454a1c9ef797 |
---|---|
4508 abort = abort || set_ref_in_functions(copyID); | 4508 abort = abort || set_ref_in_functions(copyID); |
4509 | 4509 |
4510 // function call arguments, if v:testing is set. | 4510 // function call arguments, if v:testing is set. |
4511 abort = abort || set_ref_in_func_args(copyID); | 4511 abort = abort || set_ref_in_func_args(copyID); |
4512 | 4512 |
4513 // funcstacks keep variables for closures | |
4514 abort = abort || set_ref_in_funcstacks(copyID); | |
4515 | |
4513 // v: vars | 4516 // v: vars |
4514 abort = abort || garbage_collect_vimvars(copyID); | 4517 abort = abort || garbage_collect_vimvars(copyID); |
4515 | 4518 |
4516 // callbacks in buffers | 4519 // callbacks in buffers |
4517 abort = abort || set_ref_in_buffers(copyID); | 4520 abort = abort || set_ref_in_buffers(copyID); |
4867 } | 4870 } |
4868 | 4871 |
4869 for (i = 0; i < pt->pt_argc; ++i) | 4872 for (i = 0; i < pt->pt_argc; ++i) |
4870 abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID, | 4873 abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID, |
4871 ht_stack, list_stack); | 4874 ht_stack, list_stack); |
4872 if (pt->pt_funcstack != NULL) | 4875 // pt_funcstack is handled in set_ref_in_funcstacks() |
4873 { | |
4874 typval_T *stack = pt->pt_funcstack->fs_ga.ga_data; | |
4875 | |
4876 for (i = 0; i < pt->pt_funcstack->fs_ga.ga_len; ++i) | |
4877 abort = abort || set_ref_in_item(stack + i, copyID, | |
4878 ht_stack, list_stack); | |
4879 } | |
4880 | |
4881 } | 4876 } |
4882 } | 4877 } |
4883 #ifdef FEAT_JOB_CHANNEL | 4878 #ifdef FEAT_JOB_CHANNEL |
4884 else if (tv->v_type == VAR_JOB) | 4879 else if (tv->v_type == VAR_JOB) |
4885 { | 4880 { |