summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/yarr/RegexJIT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/yarr/RegexJIT.cpp')
-rw-r--r--JavaScriptCore/yarr/RegexJIT.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index 9eff75a..5a53ced 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -1466,7 +1466,17 @@ public:
{
generate();
- LinkBuffer patchBuffer(this, globalData->executableAllocator.poolForSize(size()));
+ RefPtr<ExecutablePool> executablePool = globalData->executableAllocator.poolForSize(size());
+ if (!executablePool) {
+ m_shouldFallBack = true;
+ return;
+ }
+
+ LinkBuffer patchBuffer(this, executablePool.release(), 0);
+ if (!patchBuffer.allocationSuccessful()) {
+ m_shouldFallBack = true;
+ return;
+ }
for (unsigned i = 0; i < m_backtrackRecords.size(); ++i)
patchBuffer.patch(m_backtrackRecords[i].dataLabel, patchBuffer.locationOf(m_backtrackRecords[i].backtrackLocation));