patch 8.2.4333: cstack not always passed to where it is needed
Problem: cstack not always passed to where it is needed.
Solution: Pass ctack through functions.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 5f80988..265ea66 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -532,7 +532,12 @@
* 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 @@
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 @@
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(