]> granicus.if.org Git - vim/commitdiff
patch 8.0.1561: crash with rust syntax highligting v8.0.1561
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Mar 2018 19:02:19 +0000 (20:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Mar 2018 19:02:19 +0000 (20:02 +0100)
Problem:    Crash with rust syntax highligting. (Edd Barrett)
Solution:   Avoid going past the end of an empty line.

src/syntax.c
src/version.c

index 81f46047097bb2f92d28295876961861b968dec2..d0d4515e0e07c95987e5d59a1e2df48c8ea5137b 100644 (file)
@@ -2470,7 +2470,8 @@ syn_current_attr(
 
     /* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */
     if (current_next_list != NULL
-           && syn_getcurline()[current_col + 1] == NUL
+           && (line = syn_getcurline())[current_col] != NUL
+           && line[current_col + 1] == NUL
            && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
        current_next_list = NULL;
 
index f8777dcfdfd5a8e073892b06d720c0792c54bed1..ae51d723e34add04a1089629304a0344bcdb0764 100644 (file)
@@ -778,6 +778,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1561,
 /**/
     1560,
 /**/