diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-06-15 22:06:14 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-06-15 22:06:14 +0200 |
| commit | c8c61a12c39a0e2df7c38b21a035b0c03759dc1e (patch) | |
| tree | c5b1f7d01dab2821a5a4e02f912199d36e4593c4 /src/video_core/macro.cpp | |
| parent | b05463ee1943745e7d272fba00985590874a4b40 (diff) | |
[dynarmic, MacroHLE] Fix crashes on W^X systems (#4090)
should fix crashes on:
- NetBSD
- SELinux
- OpenBSD
- other W^X systems
- some person trying to be funny with W^X on their system even if they dont have to
perf impact should be minimal
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4090
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Diffstat (limited to 'src/video_core/macro.cpp')
| -rw-r--r-- | src/video_core/macro.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index dbf011860e..76a054665c 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -1117,6 +1117,8 @@ void MacroJITx64Impl::Optimizer_ScanFlags() { } void MacroJITx64Impl::Compile() { + // Matching PROTECT_RE needed for W^X systems + setProtectMode(Xbyak::CodeArray::ProtectMode::PROTECT_RW); labels.fill(Xbyak::Label()); Common::X64::ABI_PushRegistersAndAdjustStack(*this, Common::X64::ABI_ALL_CALLEE_SAVED, 8); @@ -1164,6 +1166,7 @@ void MacroJITx64Impl::Compile() { Common::X64::ABI_PopRegistersAndAdjustStack(*this, Common::X64::ABI_ALL_CALLEE_SAVED, 8); ret(); ready(); + setProtectMode(Xbyak::CodeArray::ProtectMode::PROTECT_RE); program = getCode<ProgramType>(); } |
