From 6a2ebc47cfa57dacf5e29083dade8701e1f82bbe Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 1 Feb 2018 13:00:46 +0100 Subject: Fix crashes on WinRT when allocation of executable memory is disabled This regressed in commit b56f7d6f79b0de73c405b1503bfeb71ef5caf58f. We need to choose the YARR JIT (as well as the regular JIT) only if we can allocate executable memory. Change-Id: I150238fda7b3699cb1d7ffedeeed3c6f3f54132b Reviewed-by: Oliver Wolff Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4regexp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/jsruntime/qv4regexp.cpp') diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp index fb49def317..36616bc024 100644 --- a/src/qml/jsruntime/qv4regexp.cpp +++ b/src/qml/jsruntime/qv4regexp.cpp @@ -82,7 +82,7 @@ Heap::RegExp *RegExp::create(ExecutionEngine* engine, const QString& pattern, bo return result->d(); Scope scope(engine); - Scoped result(scope, engine->memoryManager->alloc(pattern, ignoreCase, multiline, global)); + Scoped result(scope, engine->memoryManager->alloc(engine, pattern, ignoreCase, multiline, global)); result->d()->cache = cache; cachedValue.set(engine, result); @@ -90,7 +90,7 @@ Heap::RegExp *RegExp::create(ExecutionEngine* engine, const QString& pattern, bo return result->d(); } -void Heap::RegExp::init(const QString &pattern, bool ignoreCase, bool multiline, bool global) +void Heap::RegExp::init(ExecutionEngine *engine, const QString &pattern, bool ignoreCase, bool multiline, bool global) { Base::init(); this->pattern = new QString(pattern); @@ -106,7 +106,7 @@ void Heap::RegExp::init(const QString &pattern, bool ignoreCase, bool multiline, return; subPatternCount = yarrPattern.m_numSubpatterns; #if ENABLE(YARR_JIT) - if (!yarrPattern.m_containsBackreferences) { + if (!yarrPattern.m_containsBackreferences && engine->canJIT()) { jitCode = new JSC::Yarr::YarrCodeBlock; JSC::JSGlobalData dummy(internalClass->engine->regExpAllocator); JSC::Yarr::jitCompile(yarrPattern, JSC::Yarr::Char16, &dummy, *jitCode); -- cgit v1.2.3