libraries/v8/platform-posix.cc
// Get rid of writable permission on code allocations.
Get rid of writable permission on code allocations.
Get rid of writable permission on code allocations .
void OS::ProtectCode(void* address, const size_t size) {
#if defined(__CYGWIN__)
  DWORD old_protect;
  VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect);
#elif defined(__native_client__)
  mprotect(address, size, PROT_READ);
#else
  mprotect(address, size, PROT_READ | PROT_EXEC);
#endif
}
void OS :: ProtectCode ( void * address , const size_t size ) { #if defined ( __CYGWIN__ ) DWORD old_protect ; VirtualProtect ( address , size , PAGE_EXECUTE_READ , & old_protect ) ; #elif defined ( __native_client__ ) mprotect ( address , size , PROT_READ ) ; #else mprotect ( address , size , PROT_READ | PROT_EXEC ) ; #endif }
Get rid of writable permission on code allocations.
Get rid of writable permission on code allocations .
// The Native Client port of V8 uses an interpreter, so // code pages don't need PROT_EXEC.