diff options
author | Markus Heidelberg <markus.heidelberg@web.de> | 2015-01-11 09:04:35 +1100 |
---|---|---|
committer | Markus Heidelberg <markus.heidelberg@web.de> | 2015-01-11 09:04:35 +1100 |
commit | 813d67c7121f396049e468c1b4ae23f2fb779814 (patch) | |
tree | bf79a932ac2819b48e7a01e916b07c34768e40fe | |
parent | 6b703450e0115cf796c393103d427ad846549826 (diff) | |
download | scintilla-mirror-813d67c7121f396049e468c1b4ae23f2fb779814.tar.gz |
LexHex: add a default case for handling faulty states to all lexers
If the state variable is set to a state not used in this lexer, an
endless loop would occur because Forward() is never invoked then.
-rw-r--r-- | lexers/LexHex.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lexers/LexHex.cxx b/lexers/LexHex.cxx index c0ffa0cbe..f3a31d5a2 100644 --- a/lexers/LexHex.cxx +++ b/lexers/LexHex.cxx @@ -700,6 +700,11 @@ static void ColouriseSrecDoc(unsigned int startPos, int length, int initStyle, W sc.SetState(SCE_HEX_GARBAGE); ForwardWithinLine(sc); break; + + default: + // prevent endless loop in faulty state + sc.SetState(SCE_HEX_DEFAULT); + break; } } sc.Complete(); @@ -811,6 +816,11 @@ static void ColouriseIHexDoc(unsigned int startPos, int length, int initStyle, W sc.SetState(SCE_HEX_GARBAGE); ForwardWithinLine(sc); break; + + default: + // prevent endless loop in faulty state + sc.SetState(SCE_HEX_DEFAULT); + break; } } sc.Complete(); @@ -956,6 +966,11 @@ static void ColouriseTEHexDoc(unsigned int startPos, int length, int initStyle, sc.SetState(SCE_HEX_GARBAGE); ForwardWithinLine(sc); break; + + default: + // prevent endless loop in faulty state + sc.SetState(SCE_HEX_DEFAULT); + break; } } sc.Complete(); |