Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,13 @@ void Highlighter::changeContext(const QString &contextName,
{
if (contextName.startsWith(kPop)) {
QStringList list = contextName.split(kHash, qtSkipEmptyParts);
for (int i = 0; i < list.size(); ++i)
for (int i = 0; i < list.size(); ++i) {
// A malformed definition can attempt to pop the base context. Keep it
// as the fallback context instead of underflowing the stack.
if (m_contexts.size() <= 1)
break;
m_contexts.pop_back();
}

if (extractObservableState(currentBlockState()) >= PersistentsStart) {
// One or more contexts were popped during during a persistent state.
Expand Down
Loading