Mercurial > vim
comparison src/structs.h @ 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 | 28745eec1dda |
children | 2126feddeda6 |
comparison
equal
deleted
inserted
replaced
26559:177872ca0db9 | 26560:454a1c9ef797 |
---|---|
2007 | 2007 |
2008 /* | 2008 /* |
2009 * Structure to hold the context of a compiled function, used by closures | 2009 * Structure to hold the context of a compiled function, used by closures |
2010 * defined in that function. | 2010 * defined in that function. |
2011 */ | 2011 */ |
2012 typedef struct funcstack_S | 2012 typedef struct funcstack_S funcstack_T; |
2013 { | 2013 |
2014 struct funcstack_S | |
2015 { | |
2016 funcstack_T *fs_next; // linked list at "first_funcstack" | |
2017 funcstack_T *fs_prev; | |
2018 | |
2014 garray_T fs_ga; // contains the stack, with: | 2019 garray_T fs_ga; // contains the stack, with: |
2015 // - arguments | 2020 // - arguments |
2016 // - frame | 2021 // - frame |
2017 // - local variables | 2022 // - local variables |
2018 int fs_var_offset; // count of arguments + frame size == offset to | 2023 int fs_var_offset; // count of arguments + frame size == offset to |
2019 // local variables | 2024 // local variables |
2020 | 2025 |
2021 int fs_refcount; // nr of closures referencing this funcstack | 2026 int fs_refcount; // nr of closures referencing this funcstack |
2022 int fs_min_refcount; // nr of closures on this funcstack | 2027 int fs_min_refcount; // nr of closures on this funcstack |
2023 int fs_copyID; // for garray_T collection | 2028 int fs_copyID; // for garray_T collection |
2024 } funcstack_T; | 2029 }; |
2025 | 2030 |
2026 typedef struct outer_S outer_T; | 2031 typedef struct outer_S outer_T; |
2027 struct outer_S { | 2032 struct outer_S { |
2028 garray_T *out_stack; // stack from outer scope | 2033 garray_T *out_stack; // stack from outer scope |
2029 int out_frame_idx; // index of stack frame in out_stack | 2034 int out_frame_idx; // index of stack frame in out_stack |