Skip to content

Commit

Permalink
unbreak x86 page permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Mar 12, 2024
1 parent ad27244 commit 881b241
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/target/DarwinTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ using vm_size = vm_size_t;
#endif

Result<> DarwinTarget::allocatePage() {
#if defined(TULIP_NO_WX)
auto const protection = PROT_READ | PROT_WRITE;
#else
auto const protection = PROT_READ | PROT_WRITE | PROT_EXEC;
#endif

auto const flags = MAP_PRIVATE | MAP_ANONYMOUS;

auto ret = mmap(nullptr, PAGE_MAX_SIZE, protection, flags, -1, 0);
Expand Down

0 comments on commit 881b241

Please sign in to comment.