aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexVerilog.cxx
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2018-09-18 13:00:08 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2018-09-18 13:00:08 +1000
commit7263fd79dc1b9e150d7a9e22c52c34d7b5a123dd (patch)
tree95ce0eec176af6713321ffdd6fd19af097f6fe06 /lexers/LexVerilog.cxx
parent951d567659000925cbeaf03dbe6b9efc75802cac (diff)
downloadscintilla-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.cxx6
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) {