diff src/vim9compile.c @ 25332:34fe6aca48c2 v8.2.3203

patch 8.2.3203: Vim9: compiled string expression causes type error Commit: https://github.com/vim/vim/commit/cd268017cf79a546a494883b4b026a3cbbd9a8a0 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 22 19:11:08 2021 +0200 patch 8.2.3203: Vim9: compiled string expression causes type error Problem: Vim9: compiled string expression causes type error. (Yegappan Lakshmanan) Solution: Remove the string type from the stack.
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Jul 2021 19:15:04 +0200
parents cfbf40f749b0
children 92e7a55ab0ff
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3244,6 +3244,9 @@ compile_string(isn_T *isn, cctx_T *cctx)
     int		instr_count;
     isn_T	*instr = NULL;
 
+    // Remove the string type from the stack.
+    --cctx->ctx_type_stack.ga_len;
+
     // Temporarily reset the list of instructions so that the jump labels are
     // correct.
     cctx->ctx_instr.ga_len = 0;
@@ -4263,8 +4266,8 @@ compile_subscript(
 	    }
 	}
 
-	// Do not skip over white space to find the "(", "execute 'x' ()" is
-	// not a function call.
+	// Do not skip over white space to find the "(", "execute 'x' (expr)"
+	// is not a function call.
 	if (**arg == '(')
 	{
 	    garray_T    *stack = &cctx->ctx_type_stack;