diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-11 11:33:26 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-12 20:57:49 +0100 |
commit | ab15d9a547dbd83bec99366e7f7b0449fdcdb6ef (patch) | |
tree | c6714b3d3c959d142d9a9c7778f3d2ca8b6ccb25 /src/qml/jit/qv4assemblercommon.cpp | |
parent | c57b803e26c3f98b4f22bcc0f1029fb963e92b0e (diff) |
masm: Add error handling for failed mprotect()
If we cannot mprotect() we have to abort the JIT compilation. Delete
RepatchBuffer.h as it is unfixable in that regard. Luckily we don't use
it.
Task-number: QTBUG-89659
Change-Id: Ic5ddbdf51b471db4ddeaa75aab48b24c1f7ced56
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 131e2c81d40e3d324c62e113749a08e7993d008f)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jit/qv4assemblercommon.cpp')
-rw-r--r-- | src/qml/jit/qv4assemblercommon.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jit/qv4assemblercommon.cpp b/src/qml/jit/qv4assemblercommon.cpp index cc8af723b2..95070fbb96 100644 --- a/src/qml/jit/qv4assemblercommon.cpp +++ b/src/qml/jit/qv4assemblercommon.cpp @@ -159,7 +159,8 @@ void PlatformAssemblerCommon::link(Function *function, const char *jitKind) generateFunctionTable(function, &codeRef); - linkBuffer.makeExecutable(); + if (Q_UNLIKELY(!linkBuffer.makeExecutable())) + function->jittedCode = nullptr; // The function is not executable, but the coderef exists. } void PlatformAssemblerCommon::prepareCallWithArgCount(int argc) |