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 | 9808da6fa62255d1ad77d988ef3617a2381e3299 (patch) | |
tree | cedb96c73248e455d27642cfd8ac7b15ab5731fb /lexers/LexVerilog.cxx | |
parent | d06d0ee3e6cc590b179320f88d33335a5cab1446 (diff) | |
download | scintilla-mirror-9808da6fa62255d1ad77d988ef3617a2381e3299.tar.gz |
Backport: Guard against shifting by negative amount as that is undefined behaviour.
Backport of changeset 7090:041e498f21d3.
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 c4e40e1ec..3dc2ac1ef 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) { |