summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-03-04 09:33:42 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-03-07 19:36:24 +0000
commit53ce0d1a31c8ebb54952887b8bcf769843d50d9c (patch)
tree599da5178c8ede0d80dc30ca6c24cd79f1699534 /src/corelib/tools
parenta8c74ddcf78604c9038ba2a2bea81e445e4b3c58 (diff)
QStringAlgorithms::simplified_helper: add missing check for detached
Otherwise, we modify shared strings that happened to be rvalues. Task-number: QTBUG-44706 Change-Id: Ia0aac2f09e9245339951ffff13c85bfc912f03d1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qstringalgorithms_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstringalgorithms_p.h b/src/corelib/tools/qstringalgorithms_p.h
index 1481b194eb..b4be5c7ec7 100644
--- a/src/corelib/tools/qstringalgorithms_p.h
+++ b/src/corelib/tools/qstringalgorithms_p.h
@@ -114,7 +114,7 @@ template <typename StringType> struct QStringAlgorithms
return str;
const Char *src = str.cbegin();
const Char *end = str.cend();
- NakedStringType result = isConst ?
+ NakedStringType result = isConst || !str.isDetached() ?
StringType(str.size(), Qt::Uninitialized) :
qMove(str);