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:
10
src/vim9.h
10
src/vim9.h
@@ -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
|
||||
|
Reference in New Issue
Block a user