summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-08 21:17:22 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-08 21:17:22 +0000
commitb6a138eb334621f60c5891d035f80f398d59dbd3 (patch)
treecc5a52690b5e52b64c0dfe2e489e5f01feabac68 /src/vim9compile.c
parentdce2441a603f2c9343a4a46091283a32420d80a2 (diff)
downloadvim-git-b6a138eb334621f60c5891d035f80f398d59dbd3.tar.gz
patch 8.2.4333: cstack not always passed to where it is neededv8.2.4333
Problem: cstack not always passed to where it is needed. Solution: Pass ctack through functions.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 5f80988b8..265ea665b 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -532,7 +532,12 @@ check_item_writable(svar_T *sv, int check_writable, char_u *name)
* If not found or the variable is not writable returns -2.
*/
int
-get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx)
+get_script_item_idx(
+ int sid,
+ char_u *name,
+ int check_writable,
+ cctx_T *cctx,
+ cstack_T *cstack)
{
hashtab_T *ht;
dictitem_T *di;
@@ -544,7 +549,7 @@ get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx)
return -1;
if (sid == current_sctx.sc_sid)
{
- sallvar_T *sav = find_script_var(name, 0, cctx, NULL);
+ sallvar_T *sav = find_script_var(name, 0, cctx, cstack);
if (sav == NULL)
return -2;
@@ -1449,7 +1454,7 @@ compile_lhs(
lhs->lhs_scriptvar_idx = get_script_item_idx(
lhs->lhs_scriptvar_sid, rawname,
lhs->lhs_has_index ? ASSIGN_FINAL : ASSIGN_CONST,
- cctx);
+ cctx, NULL);
if (lhs->lhs_scriptvar_idx >= 0)
{
scriptitem_T *si = SCRIPT_ITEM(