aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4executableallocator.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-12-16 16:45:36 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-12-17 10:11:31 +0100
commit86a595b126bc6794380dc00af80ec4802f7d058c (patch)
tree7409afe1f0f42c33b65f2316dfc786825fc28934 /src/qml/jsruntime/qv4executableallocator.cpp
parentd99d192884608408759492bd656ab99a2f4f23ed (diff)
JIT: When making memory writable, include the exception handler
makeWritable() rounds the memory down to the next page boundary. Usually we include the exception handler this way, unless the offset from the page boundary is less than the exception handler size. Make it explicit that we do want the exception handler to be writable, too. Fixes: QTBUG-89513 Pick-to: 5.15 6.0 Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executableallocator.cpp')
-rw-r--r--src/qml/jsruntime/qv4executableallocator.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4executableallocator.cpp b/src/qml/jsruntime/qv4executableallocator.cpp
index 7ee6f39aa2..c06773d3c5 100644
--- a/src/qml/jsruntime/qv4executableallocator.cpp
+++ b/src/qml/jsruntime/qv4executableallocator.cpp
@@ -45,12 +45,22 @@
using namespace QV4;
-void *ExecutableAllocator::Allocation::exceptionHandler() const
+void *ExecutableAllocator::Allocation::exceptionHandlerStart() const
{
return reinterpret_cast<void*>(addr);
}
-void *ExecutableAllocator::Allocation::start() const
+size_t ExecutableAllocator::Allocation::exceptionHandlerSize() const
+{
+ return QV4::exceptionHandlerSize();
+}
+
+void *ExecutableAllocator::Allocation::memoryStart() const
+{
+ return reinterpret_cast<void*>(addr);
+}
+
+void *ExecutableAllocator::Allocation::codeStart() const
{
return reinterpret_cast<void*>(addr + exceptionHandlerSize());
}