diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-12-16 16:45:36 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-26 08:26:39 +0000 |
commit | 35614462443c100b6753b335b58a134fed4b5c35 (patch) | |
tree | 444eb4aba4fa1f9aebe562f3400e6db9d5181dc3 /src/qml/jsruntime/qv4executableallocator.cpp | |
parent | bb0ce1ffd48aa69da03dc43bd314351519ebf0d7 (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
Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 86a595b126bc6794380dc00af80ec4802f7d058c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/jsruntime/qv4executableallocator.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4executableallocator.cpp | 14 |
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()); } |