From 190aa94be7f5e146bef44862b974d733755cec85 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 14 Aug 2017 18:30:29 +0200 Subject: Change source identifier type in ProString The strings remember in which file they were created/assigned. However, this used a non-counting reference to a ProFile, which could become dangling. If a subsequent ProFile re-used the exact same address, a string's source would be mis-identified, which would be fatal in conjunction with discard_from(). Since we actually need only a unique id for comparison, let's use an integer for that. Task-number: QTBUG-62434 Started-by: Simon Hausmann Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a Reviewed-by: Simon Hausmann --- qmake/library/proitems.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qmake/library/proitems.cpp') diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index ff1236f64a..1744304c67 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -477,9 +477,10 @@ bool ProStringList::contains(const char *str, Qt::CaseSensitivity cs) const return false; } -ProFile::ProFile(const QString &fileName) +ProFile::ProFile(int id, const QString &fileName) : m_refCount(1), m_fileName(fileName), + m_id(id), m_ok(true), m_hostBuild(false) { @@ -496,7 +497,7 @@ ProString ProFile::getStr(const ushort *&tPtr) { uint len = *tPtr++; ProString ret(items(), tPtr - tokPtr(), len); - ret.setSource(this); + ret.setSource(m_id); tPtr += len; return ret; } -- cgit v1.2.3