From 80e63223f80643a93255cde9e0a4e82c705b2262 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Nov 2016 20:41:20 +0100 Subject: make qmake abort when $$prompt() gets EOF otherwise, infinite loops can result, as amply demonstrated by the new configure (which duly replicated the old configures' behavior ...). QMakeEvaluator::evaluateBuiltinExpand() now returns a VisitReturn like all other evaluate*() functions. the string list return value is now an out parameter; i used a reference instead of a pointer to avoid adjusting 56 usages of it. Task-number: QTBUG-13964 Change-Id: I51ca7df8d694c6ffe9d9899cba414b1b46f5ce95 Reviewed-by: Lars Knoll --- qmake/library/qmakeevaluator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qmake/library/qmakeevaluator.cpp') diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 017fc3434c..cc57aa7f2b 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1774,8 +1774,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateExpandFunction( ProStringList args; if (expandVariableReferences(tokPtr, 5, &args, true) == ReturnError) return ReturnError; - *ret = evaluateBuiltinExpand(func_t, func, args); - return ReturnTrue; + return evaluateBuiltinExpand(func_t, func, args, *ret); } QHash::ConstIterator it = -- cgit v1.2.3 From b6b44b368c6fc2df168195eaee57a2f925a29646 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 11 Nov 2016 11:40:24 +0100 Subject: qmake: introduce magic bypassNesting() scope will be needed by configure. Change-Id: If14e6944fe84767bd67604ecde98076f873749ef Reviewed-by: Lars Knoll --- qmake/library/qmakeevaluator.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'qmake/library/qmakeevaluator.cpp') diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index cc57aa7f2b..4ca87e8bc7 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -594,6 +594,24 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock( tokPtr += blockLen; okey = true, or_op = false; // force next evaluation break; + case TokBypassNesting: + blockLen = getBlockLen(tokPtr); + if ((m_cumulative || okey != or_op) && blockLen) { + ProValueMapStack savedValuemapStack = m_valuemapStack; + m_valuemapStack.clear(); + m_valuemapStack.append(savedValuemapStack.takeFirst()); + traceMsg("visiting nesting-bypassing block"); + ret = visitProBlock(tokPtr); + traceMsg("visited nesting-bypassing block"); + savedValuemapStack.prepend(m_valuemapStack.first()); + m_valuemapStack = savedValuemapStack; + } else { + traceMsg("skipped nesting-bypassing block"); + ret = ReturnTrue; + } + tokPtr += blockLen; + okey = true, or_op = false; // force next evaluation + break; case TokTestDef: case TokReplaceDef: if (m_cumulative || okey != or_op) { -- cgit v1.2.3