0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1778: Vim9: returning from a partial call clears outer context

Problem:    Vim9: returning from a partial call clears outer context, causing
            a crash.
Solution:   Put the outer context in the stack frame. (closes #7044)
This commit is contained in:
Bram Moolenaar
2020-10-01 13:01:34 +02:00
parent 55759b5228
commit 5366e1aecf
4 changed files with 31 additions and 6 deletions

View File

@@ -326,10 +326,12 @@ struct dfunc_S {
};
// Number of entries used by stack frame for a function call.
// - function index
// - instruction index
// - previous frame index
#define STACK_FRAME_SIZE 3
// - ec_dfunc_idx: function index
// - ec_iidx: instruction index
// - ec_outer_stack: stack used for closures TODO: can we avoid this?
// - ec_outer_frame: stack frame for closures
// - ec_frame_idx: previous frame index
#define STACK_FRAME_SIZE 5
#ifdef DEFINE_VIM9_GLOBALS