diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2018-09-18 13:00:08 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2018-09-18 13:00:08 +1000 |
commit | 7263fd79dc1b9e150d7a9e22c52c34d7b5a123dd (patch) | |
tree | 95ce0eec176af6713321ffdd6fd19af097f6fe06 /lexers/LexVerilog.cxx | |
parent | 951d567659000925cbeaf03dbe6b9efc75802cac (diff) | |
download | scintilla-mirror-7263fd79dc1b9e150d7a9e22c52c34d7b5a123dd.tar.gz |
Guard against shifting by negative amount as that is undefined behaviour.
Diffstat (limited to 'lexers/LexVerilog.cxx')
-rw-r--r-- | lexers/LexVerilog.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lexers/LexVerilog.cxx b/lexers/LexVerilog.cxx index 901b6e93d..640f12fcb 100644 --- a/lexers/LexVerilog.cxx +++ b/lexers/LexVerilog.cxx @@ -57,7 +57,11 @@ class LinePPState { return level >= 0 && level < 32; } int maskLevel() const { - return 1 << level; + if (level >= 0) { + return 1 << level; + } else { + return 1; + } } public: LinePPState() : state(0), ifTaken(0), level(-1) { |