]> granicus.if.org Git - vim/commitdiff
patch 8.2.1156: Vim9: No error for invalid command in compiled function v8.2.1156
authorBram Moolenaar <Bram@vim.org>
Wed, 8 Jul 2020 15:47:57 +0000 (17:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 Jul 2020 15:47:57 +0000 (17:47 +0200)
Problem:    Vim9: No error for invalid command in compiled function.
Solution:   Handle CMD_SIZE.

src/testdir/test_vim9_expr.vim
src/version.c
src/vim9compile.c

index b3906c1b98b7723dc698391b376cd2597d6f9327..dd2a8ade51919c6b59db4f8aa5574f8c022c363d 100644 (file)
@@ -1420,7 +1420,7 @@ func Test_expr_fails()
   call CheckDefFailure(["let x = '1'is2"], 'E488:')
   call CheckDefFailure(["let x = '1'isnot2"], 'E488:')
 
-  call CheckDefExecFailure(["CallMe ('yes')"], 'E492:')
+  call CheckDefFailure(["CallMe ('yes')"], 'E476:')
   call CheckDefFailure(["CallMe2('yes','no')"], 'E1069:')
   call CheckDefFailure(["CallMe2('yes' , 'no')"], 'E1068:')
 
index c77d0bc7cdb862aafb57abb46b8fb03c38864f58..e362e270572e68b13c138200f907d47b09aebd50 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1156,
 /**/
     1155,
 /**/
index c3c380852a9c6149ca45ed78732475f44ef52e44..07aacb37c07d456af7896f5649d1780b3fbc8560 100644 (file)
@@ -7142,6 +7142,10 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
 
            // TODO: other commands with an expression argument
 
+           case CMD_SIZE:
+                   semsg(_("E476: Invalid command: %s"), ea.cmd);
+                   goto erret;
+
            default:
                    // Not recognized, execute with do_cmdline_cmd().
                    ea.arg = p;