From 217db813fc2463bc7042639d4120d7a89e2395b8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 27 Aug 2012 11:53:32 +0200 Subject: [PATCH] make the value map stack QLinkedList-based this ensures that the addresses of the maps stay constant, which the qmake generators assume. Change-Id: Ic9f20c75527e0d741a2d4f89d2c587e12724d2ed Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index cbc2b12959a..68212e05fbb 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -39,6 +39,7 @@ #include "ioutils.h" #include +#include #include #include #include @@ -71,7 +72,16 @@ public: virtual void doneWithEval(ProFile *parent) = 0; }; -typedef QStack ProValueMapStack; +// We use a QLinkedList based stack instead of a QVector based one (QStack), so that +// the addresses of value maps stay constant. The qmake generators rely on that. +class QMAKE_EXPORT ProValueMapStack : public QLinkedList +{ +public: + inline void push(const ProValueMap &t) { append(t); } + inline ProValueMap pop() { return takeLast(); } + ProValueMap &top() { return last(); } + const ProValueMap &top() const { return last(); } +}; class QMAKE_EXPORT QMakeEvaluator {