diff --git a/src/plugins/qmljseditor/qmljshighlighter.cpp b/src/plugins/qmljseditor/qmljshighlighter.cpp
index f3b905e32e49158f88eb21695eac3c5846ea4da5..e7965286d4f266e2767c6bb9eb6803502eb4a120 100644
--- a/src/plugins/qmljseditor/qmljshighlighter.cpp
+++ b/src/plugins/qmljseditor/qmljshighlighter.cpp
@@ -326,7 +326,7 @@ int Highlighter::onBlockStart()
     int previousState = previousBlockState();
     if (previousState != -1) {
         state = previousState & 0xff;
-        m_braceDepth = previousState >> 8;
+        m_braceDepth = (previousState >> 8);
         m_inMultilineComment = (state == Scanner::MultiLineComment);
     }
     m_foldingIndent = m_braceDepth;