X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fwin32%2FOSMem.c;h=356c6dffa407557bd590c1a05f723ea968efa953;hb=e5d7f9c6013d1be616fa7a54e34e9ae9bac30218;hp=fe69a341e828108ae78d53e177ccc3bd78a42765;hpb=e3c55aebd4f9ce7a5b4390d4726612865fd207f2;p=ghc-hetmet.git diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index fe69a34..356c6df 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -7,6 +7,8 @@ * ---------------------------------------------------------------------------*/ #include +#include "Rts.h" +#include "OSMem.h" lnat getPageSize (void) { @@ -24,11 +26,11 @@ lnat getPageSize (void) void setExecutable (void *p, lnat len, rtsBool exec) { DWORD dwOldProtect = 0; - if (VirtualProtect (addr, len, + if (VirtualProtect (p, len, exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &dwOldProtect) == 0) { barf("makeExecutable: failed to protect 0x%p; error=%lu; old protection: %lu\n", - addr, (unsigned long)GetLastError(), (unsigned long)dwOldProtect); + p, (unsigned long)GetLastError(), (unsigned long)dwOldProtect); } }