Skip to content

Assertion failure for incorrect SGML #340

@nyamatongwe

Description

@nyamatongwe

For this SGML, the '{' is not allowed and terminates SCE_H_SGML_COMMAND but the command is empty which fails inside isWordHSGML.

<!{2}>

Potential fix:

+++ b/lexers/LexHTML.cxx
@@ -453,6 +453,8 @@ void classifyWordHTPHP(Sci_PositionU start, Sci_PositionU end, const WordList &k
 }
 
 bool isWordHSGML(Sci_PositionU start, Sci_PositionU end, const WordList &keywords, const Accessor &styler) {
+	if (end < start)
+		return false;
 	const std::string s = styler.GetRange(start, end + 1);
 	return keywords.InList(s);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    committedIssue fixed in repository but not in releasehtmlCaused by the hypertext lexer

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions