From c1623a0d42c9869e5a1d04081e7660722a863de5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 23 Apr 2012 16:29:18 +0200 Subject: Don't use the QRegExp methods that modify the object QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: I2c4d5f4b60d6b3569568103cd7107cd2adaa3ae8 Reviewed-by: Giuseppe D'Angelo Reviewed-by: Lars Knoll --- src/xmlpatterns/functions/qpatternplatform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xmlpatterns/functions/qpatternplatform.cpp') diff --git a/src/xmlpatterns/functions/qpatternplatform.cpp b/src/xmlpatterns/functions/qpatternplatform.cpp index 08dc2f1..e9bbfbb 100644 --- a/src/xmlpatterns/functions/qpatternplatform.cpp +++ b/src/xmlpatterns/functions/qpatternplatform.cpp @@ -115,7 +115,7 @@ PatternPlatform::PatternPlatform(const qint8 flagsPosition) : m_compiledParts(No { } -const QRegExp PatternPlatform::pattern(const DynamicContext::Ptr &context) const +QRegExp PatternPlatform::pattern(const DynamicContext::Ptr &context) const { if(m_compiledParts == FlagsAndPattern) /* This is the most common case. */ { -- cgit v1.2.1