Commit 7feed731 authored by Sebastian Hartte's avatar Sebastian Hartte Committed by Oswald Buddenhagen
Browse files

Fixed a crash when deleting files from a project under certain conditions



Task-number: QTCREATORBUG-1804
Merge-request: 2168
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>
parent 8af5c9e1
...@@ -229,18 +229,18 @@ void ProWriter::addVarValues(ProFile *profile, QStringList *lines, ...@@ -229,18 +229,18 @@ void ProWriter::addVarValues(ProFile *profile, QStringList *lines,
} }
static void findProVariables(const ushort *tokPtr, const QStringList &vars, static void findProVariables(const ushort *tokPtr, const QStringList &vars,
QList<int> *proVars) QList<int> *proVars, const uint firstLine = 0)
{ {
int lineNo = 0; int lineNo = firstLine;
QString tmp; QString tmp;
const ushort *lastXpr = 0; const ushort *lastXpr = 0;
while (ushort tok = *tokPtr++) { while (ushort tok = *tokPtr++) {
if (tok == TokBranch) { if (tok == TokBranch) {
uint blockLen = getBlockLen(tokPtr); uint blockLen = getBlockLen(tokPtr);
findProVariables(tokPtr, vars, proVars); findProVariables(tokPtr, vars, proVars, lineNo);
tokPtr += blockLen; tokPtr += blockLen;
blockLen = getBlockLen(tokPtr); blockLen = getBlockLen(tokPtr);
findProVariables(tokPtr, vars, proVars); findProVariables(tokPtr, vars, proVars, lineNo);
tokPtr += blockLen; tokPtr += blockLen;
} else if (tok == TokAssign || tok == TokAppend || tok == TokAppendUnique) { } else if (tok == TokAssign || tok == TokAppend || tok == TokAppendUnique) {
if (getLiteral(lastXpr, tokPtr - 1, tmp) && vars.contains(tmp)) if (getLiteral(lastXpr, tokPtr - 1, tmp) && vars.contains(tmp))
......
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