Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index bd8a33fabd13e2ec5d65be929e3c4b1fcd5e5a20..9d3d7695f0955b1f84d0b0310dda815909aec726 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -84,7 +84,13 @@ intptr_t OS::CommitPageSize() { |
#ifndef __CYGWIN__ |
// Get rid of writable permission on code allocations. |
void OS::ProtectCode(void* address, const size_t size) { |
+#if defined(__native_client__) |
+ // The Native Client port of V8 uses an interpreter, so |
+ // code pages don't need PROT_EXEC. |
+ mprotect(address, size, PROT_READ); |
+#else |
mprotect(address, size, PROT_READ | PROT_EXEC); |
+#endif |
} |