changeset 24063:d8f3a993dc9a v8.2.2573

patch 8.2.2573: Vim9: using inalid pointer for error message Commit: https://github.com/vim/vim/commit/a974953443775dd938cf9a8c195e3de9e4514f4f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 6 18:18:19 2021 +0100 patch 8.2.2573: Vim9: using inalid pointer for error message Problem: Vim9: using inalid pointer for error message. Solution: Use the right pointer. (closes https://github.com/vim/vim/issues/7921)
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Mar 2021 18:30:02 +0100
parents a29ffc423689
children 85e18722945c
files src/eval.c src/testdir/test_vim9_expr.vim src/version.c
diffstat 3 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -3130,7 +3130,7 @@ eval6(
 	 */
 	if (evaluate && in_vim9script() && !IS_WHITE_OR_NUL((*arg)[1]))
 	{
-	    error_white_both(p, 1);
+	    error_white_both(*arg, 1);
 	    clear_tv(rettv);
 	    return FAIL;
 	}
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1254,6 +1254,17 @@ def Test_expr5_vim9script()
       echo 'a' .. function('len')
   END
   CheckScriptFailure(lines, 'E729:', 2)
+
+  lines =<< trim END
+      vim9script
+      new
+      ['']->setline(1)
+      /pattern
+
+      eval 0
+      bwipe!
+  END
+  CheckScriptFailure(lines, "E1004: White space required before and after '/' at \"/pattern")
 enddef
 
 def Test_expr5_vim9script_channel()
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2573,
+/**/
     2572,
 /**/
     2571,