maintain m_lineNo better during evaluation

This commit is contained in:
Oswald Buddenhagen
2010-05-21 21:14:12 +02:00
parent b97b53d9bf
commit dad37b23d8

View File

@@ -1476,6 +1476,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProCondit
ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(ProFile *pro) ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(ProFile *pro)
{ {
m_lineNo = 0;
m_profileStack.push(pro); m_profileStack.push(pro);
if (m_profileStack.count() == 1) { if (m_profileStack.count() == 1) {
// Do this only for the initial profile we visit, since // Do this only for the initial profile we visit, since
@@ -3267,12 +3268,15 @@ bool ProFileEvaluator::Private::evaluateFile(const QString &fileName)
errorMessage(format("circular inclusion of %1").arg(fileName)); errorMessage(format("circular inclusion of %1").arg(fileName));
return false; return false;
} }
int lineNo = m_lineNo;
if (ProFile *pro = parsedProFile(fileName, true)) { if (ProFile *pro = parsedProFile(fileName, true)) {
q->aboutToEval(pro); q->aboutToEval(pro);
bool ok = (visitProFile(pro) == ReturnTrue); bool ok = (visitProFile(pro) == ReturnTrue);
pro->deref(); pro->deref();
m_lineNo = lineNo;
return ok; return ok;
} else { } else {
m_lineNo = lineNo;
return false; return false;
} }
} }
@@ -3325,10 +3329,12 @@ bool ProFileEvaluator::Private::evaluateFeatureFile(
// Don't use evaluateFile() here to avoid calling aboutToEval(). // Don't use evaluateFile() here to avoid calling aboutToEval().
// The path is fully normalized already. // The path is fully normalized already.
bool ok = false; bool ok = false;
int lineNo = m_lineNo;
if (ProFile *pro = parsedProFile(fn, true)) { if (ProFile *pro = parsedProFile(fn, true)) {
ok = (visitProFile(pro) == ReturnTrue); ok = (visitProFile(pro) == ReturnTrue);
pro->deref(); pro->deref();
} }
m_lineNo = lineNo;
m_cumulative = cumulative; m_cumulative = cumulative;
return ok; return ok;