forked from qt-creator/qt-creator
unbreak infinite recursion check for fromfile() & co.
i broke this by switching to using a separate evaluator. the new evaluator has an empty file stack, so the check would be pointless. fix it by recoding and traversing the call chain. Change-Id: Icb1f19adc6e66a865cd5be78eeb1c10072b4f8fc Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -170,6 +170,7 @@ QMakeEvaluator::QMakeEvaluator(QMakeGlobals *option,
|
||||
initStatics();
|
||||
|
||||
// Configuration, more or less
|
||||
m_caller = 0;
|
||||
#ifdef PROEVALUATOR_CUMULATIVE
|
||||
m_cumulative = false;
|
||||
#endif
|
||||
@@ -1626,11 +1627,14 @@ bool QMakeEvaluator::evaluateFile(
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
foreach (const ProFile *pf, m_profileStack)
|
||||
if (pf->fileName() == fileName) {
|
||||
evalError(fL1S("Circular inclusion of %1.").arg(fileName));
|
||||
return false;
|
||||
}
|
||||
QMakeEvaluator *ref = this;
|
||||
do {
|
||||
foreach (const ProFile *pf, ref->m_profileStack)
|
||||
if (pf->fileName() == fileName) {
|
||||
evalError(fL1S("Circular inclusion of %1.").arg(fileName));
|
||||
return false;
|
||||
}
|
||||
} while ((ref = ref->m_caller));
|
||||
return evaluateFileDirect(fileName, type, flags);
|
||||
}
|
||||
|
||||
@@ -1695,6 +1699,7 @@ bool QMakeEvaluator::evaluateFileInto(const QString &fileName, QMakeHandler::Eva
|
||||
ProValueMap *values, LoadFlags flags)
|
||||
{
|
||||
QMakeEvaluator visitor(m_option, m_parser, m_handler);
|
||||
visitor.m_caller = this;
|
||||
visitor.m_outputDir = m_outputDir;
|
||||
if (!visitor.evaluateFile(fileName, type, flags))
|
||||
return false;
|
||||
|
@@ -195,6 +195,7 @@ public:
|
||||
|
||||
static void removeEach(ProStringList *varlist, const ProStringList &value);
|
||||
|
||||
QMakeEvaluator *m_caller;
|
||||
int m_loopLevel; // To report unexpected break() and next()s
|
||||
#ifdef PROEVALUATOR_CUMULATIVE
|
||||
bool m_cumulative;
|
||||
|
Reference in New Issue
Block a user