diff src/testdir/test_vim9_func.vim @ 26960:043a15b37bf1 v8.2.4009

patch 8.2.4009: reading one byte beyond the end of the line Commit: https://github.com/vim/vim/commit/d3a117814d6acbf0dca3eff1a7626843b9b3734a Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 5 16:50:40 2022 +0000 patch 8.2.4009: reading one byte beyond the end of the line Problem: Reading one byte beyond the end of the line. Solution: Check for NUL byte first.
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Jan 2022 18:00:05 +0100
parents 4e77f9961650
children fceb494e22de
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -3537,6 +3537,17 @@ def Test_numbered_function_reference()
   unlet g:mydict
 enddef
 
+def Test_go_beyond_end_of_cmd()
+  # this was reading the byte after the end of the line
+  var lines =<< trim END
+    def F()
+      cal
+    enddef
+    defcompile
+  END
+  CheckScriptFailure(lines, 'E476:')
+enddef
+
 if has('python3')
   def Test_python3_heredoc()
     py3 << trim EOF