diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-12-01 14:29:21 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-20 07:39:40 +0100 |
commit | 9a342ea31bf6fafcb9c056989460a9beae99c486 (patch) | |
tree | 6d7b84a23dcbf4ea01a9975f3b43a7b08057ebac /src/qml/jsruntime/qv4regexp.cpp | |
parent | 4479bb58a4ae6c4520773201f41028ef1791bf73 (diff) |
Fix RegExpCache to store Heap Objects
Change-Id: I1613c438f5b862436790f81c6a3d370cfe78b6a1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4regexp.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4regexp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp index 349a0b21b0..2f1ede1b28 100644 --- a/src/qml/jsruntime/qv4regexp.cpp +++ b/src/qml/jsruntime/qv4regexp.cpp @@ -42,7 +42,7 @@ RegExpCache::~RegExpCache() { for (RegExpCache::Iterator it = begin(), e = end(); it != e; ++it) - it.value()->d()->cache = 0; + it.value()->cache = 0; clear(); } @@ -69,8 +69,8 @@ Heap::RegExp *RegExp::create(ExecutionEngine* engine, const QString& pattern, bo RegExpCache *cache = engine->regExpCache; if (cache) { - if (RegExp *result = cache->value(key)) - return result->d(); + if (Heap::RegExp *result = cache->value(key)) + return result; } Scope scope(engine); @@ -80,7 +80,7 @@ Heap::RegExp *RegExp::create(ExecutionEngine* engine, const QString& pattern, bo cache = engine->regExpCache = new RegExpCache; result->d()->cache = cache; - cache->insert(key, result); + cache->insert(key, result->d()); return result->d(); } |