]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - jit/ExecutableAllocatorWin.cpp
JavaScriptCore-584.tar.gz
[apple/javascriptcore.git] / jit / ExecutableAllocatorWin.cpp
index a9ba7d0ea1bc2e52311c4feea19e33d90dc518f5..e38323c5fddd394628cd0d8fe6842a6c53c479c5 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "ExecutableAllocator.h"
 
-#if ENABLE(ASSEMBLER)
+#if ENABLE(ASSEMBLER) && OS(WINDOWS)
 
 #include "windows.h"
 
@@ -42,7 +42,10 @@ void ExecutableAllocator::intializePageSize()
 
 ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t n)
 {
-    ExecutablePool::Allocation alloc = {reinterpret_cast<char*>(VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)), n};
+    void* allocation = VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
+    if (!allocation)
+        CRASH();
+    ExecutablePool::Allocation alloc = {reinterpret_cast<char*>(allocation), n};
     return alloc;
 }