vim-patch:8.0.1561: crash with rust syntax highligting (#8095)

Problem:    Crash with rust syntax highligting. (Edd Barrett)
Solution:   Avoid going past the end of an empty line.

069dafc1de

Closes #6248
This commit is contained in:
James McCoy 2018-03-03 16:14:16 -05:00 committed by Justin M. Keyes
parent 9f994bb699
commit c21cf6d3cc

View File

@ -2133,9 +2133,11 @@ 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
&& !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
&& (line = syn_getcurline())[current_col] != NUL
&& line[current_col + 1] == NUL
&& !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))) {
current_next_list = NULL;
}
if (!GA_EMPTY(&zero_width_next_ga))
ga_clear(&zero_width_next_ga);