Commit 13241c66 by Anthony Vallee-Dubois Committed by Nicolas Capens

Make memory for generated routines non-writable.

This change also fixes a missing include for memcmp(). Bug 14642677 Change-Id: I4207d259b9d7b20e0cb35ded65bacd5c2d882087 Reviewed-on: https://swiftshader-review.googlesource.com/3884Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 204ec087
...@@ -113,7 +113,7 @@ void markExecutable(void *memory, size_t bytes) ...@@ -113,7 +113,7 @@ void markExecutable(void *memory, size_t bytes)
unsigned long oldProtection; unsigned long oldProtection;
VirtualProtect(memory, bytes, PAGE_EXECUTE_READ, &oldProtection); VirtualProtect(memory, bytes, PAGE_EXECUTE_READ, &oldProtection);
#else #else
mprotect(memory, bytes, PROT_READ | PROT_WRITE | PROT_EXEC); mprotect(memory, bytes, PROT_READ | PROT_EXEC);
#endif #endif
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>
#include <cstring>
#include <vector> #include <vector>
using namespace std; using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment