diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-14 18:30:29 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-03-14 15:34:01 +0000 |
commit | 60245e55d7551f525c951d8d866aab081be88a69 (patch) | |
tree | a835326ccc87ea93d7c749f9f0f42f27d8ab1db2 /tests/auto | |
parent | 274726efb0bbc5055f02b1b76f2481564ad27f46 (diff) | |
download | qt-creator-60245e55d7551f525c951d8d866aab081be88a69.tar.gz |
qmake: 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.
comment on cherry-pick: this is actually a lot more than a cherry-pick,
because the file ids need to be aware of the dual VFS which was
concurrently introduced on the qtc side.
Started-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a
(cherry picked from qtbase/190aa94be7f5e146bef44862b974d733755cec85)
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/profilewriter/tst_profilewriter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/profilewriter/tst_profilewriter.cpp b/tests/auto/profilewriter/tst_profilewriter.cpp index 999ac0ae41..0e927e1e9a 100644 --- a/tests/auto/profilewriter/tst_profilewriter.cpp +++ b/tests/auto/profilewriter/tst_profilewriter.cpp @@ -448,7 +448,7 @@ void tst_ProFileWriter::adds() QMakeVfs vfs; QMakeParser parser(0, &vfs, &parseHandler); - ProFile *proFile = parser.parsedProBlock(QStringRef(&input), QLatin1String(BASE_DIR "/test.pro"), 1); + ProFile *proFile = parser.parsedProBlock(QStringRef(&input), 0, QLatin1String(BASE_DIR "/test.pro"), 1); QVERIFY(proFile); PW::putVarValues(proFile, &lines, values, var, PW::PutFlags(flags), scope); proFile->deref(); @@ -619,7 +619,7 @@ void tst_ProFileWriter::removes() QMakeVfs vfs; QMakeParser parser(0, &vfs, &parseHandler); - ProFile *proFile = parser.parsedProBlock(QStringRef(&input), QLatin1String(BASE_DIR "/test.pro"), 1); + ProFile *proFile = parser.parsedProBlock(QStringRef(&input), 0, QLatin1String(BASE_DIR "/test.pro"), 1); QVERIFY(proFile); QmakeProjectManager::Internal::ProWriter::removeVarValues(proFile, &lines, values, vars); proFile->deref(); @@ -648,7 +648,7 @@ void tst_ProFileWriter::multiVar() QMakeVfs vfs; QMakeParser parser(0, &vfs, &parseHandler); - ProFile *proFile = parser.parsedProBlock(QStringRef(&input), QLatin1String(BASE_DIR "/test.pro"), 1); + ProFile *proFile = parser.parsedProBlock(QStringRef(&input), 0, QLatin1String(BASE_DIR "/test.pro"), 1); QVERIFY(proFile); QmakeProjectManager::Internal::ProWriter::removeFiles(proFile, &lines, baseDir, files, vars); proFile->deref(); @@ -669,7 +669,7 @@ void tst_ProFileWriter::addFiles() QMakeVfs vfs; QMakeParser parser(0, &vfs, &parseHandler); - ProFile *proFile = parser.parsedProBlock(QStringRef(&input), QLatin1String(BASE_DIR "/test.pro"), 1); + ProFile *proFile = parser.parsedProBlock(QStringRef(&input), 0, QLatin1String(BASE_DIR "/test.pro"), 1); QVERIFY(proFile); QmakeProjectManager::Internal::ProWriter::addFiles(proFile, &lines, QStringList() << QString::fromLatin1(BASE_DIR "/sub/bar.cpp"), @@ -691,7 +691,7 @@ void tst_ProFileWriter::removeFiles() QMakeVfs vfs; QMakeParser parser(0, &vfs, &parseHandler); - ProFile *proFile = parser.parsedProBlock(QStringRef(&input), QLatin1String(BASE_DIR "/test.pro"), 1); + ProFile *proFile = parser.parsedProBlock(QStringRef(&input), 0, QLatin1String(BASE_DIR "/test.pro"), 1); QVERIFY(proFile); QmakeProjectManager::Internal::ProWriter::removeFiles(proFile, &lines, QDir(BASE_DIR), QStringList() << QString::fromLatin1(BASE_DIR "/sub/bar.cpp"), |