Commit 889f16c3 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

fix crash when modifiying some project files with scopes



TokBranch may hold zero-sized blocks, which must be explicitly handled
before trying to enter them.

Task-number: QTCREATORBUG-7706
Change-Id: Idaa129e12eb89cbc9572277083765fa6e15e0849
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>
parent 99cfa88b
......@@ -325,11 +325,15 @@ static void findProVariables(const ushort *tokPtr, const QStringList &vars,
while (ushort tok = *tokPtr++) {
if (tok == TokBranch) {
uint blockLen = getBlockLen(tokPtr);
findProVariables(tokPtr, vars, proVars, lineNo);
tokPtr += blockLen;
if (blockLen) {
findProVariables(tokPtr, vars, proVars, lineNo);
tokPtr += blockLen;
}
blockLen = getBlockLen(tokPtr);
findProVariables(tokPtr, vars, proVars, lineNo);
tokPtr += blockLen;
if (blockLen) {
findProVariables(tokPtr, vars, proVars, lineNo);
tokPtr += blockLen;
}
} else if (tok == TokAssign || tok == TokAppend || tok == TokAppendUnique) {
if (getLiteral(lastXpr, tokPtr - 1, tmp) && vars.contains(tmp))
*proVars << lineNo;
......
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