summaryrefslogtreecommitdiffstats
path: root/qmake/library/proitems.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-14 18:30:29 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-15 10:54:50 +0000
commit190aa94be7f5e146bef44862b974d733755cec85 (patch)
treef347424990930691ebc2b9cd39794ae74984f8f5 /qmake/library/proitems.cpp
parente6fad35155a25a932386ad6f8421efd74404ac7f (diff)
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 <simon.hausmann@qt.io> Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'qmake/library/proitems.cpp')
-rw-r--r--qmake/library/proitems.cpp5
1 files changed, 3 insertions, 2 deletions
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;
}