ports/www/chromium/patches/patch-v8_src_execution_isolate_cc

27 lines
960 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: v8/src/execution/isolate.cc
--- v8/src/execution/isolate.cc.orig
+++ v8/src/execution/isolate.cc
2023-08-18 18:38:43 +00:00
@@ -147,6 +147,10 @@
2023-08-16 22:26:55 +00:00
#include "src/execution/simulator-base.h"
#endif
+#if defined(V8_OS_OPENBSD)
+#include <sys/mman.h>
+#endif
+
extern "C" const uint8_t v8_Default_embedded_blob_code_[];
extern "C" uint32_t v8_Default_embedded_blob_code_size_;
extern "C" const uint8_t v8_Default_embedded_blob_data_[];
2023-09-14 00:49:35 +00:00
@@ -4021,6 +4025,11 @@ void Isolate::InitializeDefaultEmbeddedBlob() {
2023-08-16 22:26:55 +00:00
uint32_t code_size = DefaultEmbeddedBlobCodeSize();
const uint8_t* data = DefaultEmbeddedBlobData();
uint32_t data_size = DefaultEmbeddedBlobDataSize();
+
+#if defined(V8_OS_OPENBSD) && !defined(V8_TARGET_ARCH_IA32)
+ mprotect(reinterpret_cast<void *>(const_cast<uint8_t *>(code)),
+ code_size, PROT_READ | PROT_EXEC);
+#endif
if (StickyEmbeddedBlobCode() != nullptr) {
base::MutexGuard guard(current_embedded_blob_refcount_mutex_.Pointer());