From 131e2c81d40e3d324c62e113749a08e7993d008f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 11 Jan 2021 11:33:26 +0100 Subject: 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 Pick-to: 5.15 Change-Id: Ic5ddbdf51b471db4ddeaa75aab48b24c1f7ced56 Reviewed-by: Lars Knoll Reviewed-by: Andrei Golubev --- src/qml/jit/qv4assemblercommon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml/jit/qv4assemblercommon.cpp') diff --git a/src/qml/jit/qv4assemblercommon.cpp b/src/qml/jit/qv4assemblercommon.cpp index 137a04cc10..9cf118e04b 100644 --- a/src/qml/jit/qv4assemblercommon.cpp +++ b/src/qml/jit/qv4assemblercommon.cpp @@ -160,7 +160,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) -- cgit v1.2.3