Commit 582a082c authored by Eike Ziller's avatar Eike Ziller
Browse files

Generic Highlighter: Don't crash with bogus #pop directives.



Task-number: QTCREATORBUG-7583

Change-Id: Ie11c0c1d9b900c5d5d92c0e856bae762bb90cb4a
Reviewed-by: default avatarLeandro Melo <leandro.melo@nokia.com>
parent 624aada0
......@@ -323,8 +323,11 @@ void Highlighter::changeContext(const QString &contextName,
{
if (contextName.startsWith(kPop)) {
QStringList list = contextName.split(kHash, QString::SkipEmptyParts);
for (int i = 0; i < list.size(); ++i)
for (int i = 0; i < list.size(); ++i) {
if (m_contexts.isEmpty())
throw HighlighterException();
m_contexts.pop_back();
}
if (extractObservableState(currentBlockState()) >= PersistentsStart) {
// One or more contexts were popped during during a persistent state.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment