mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 13:00:15 +02:00
Merge pull request #4684 from Sonicadvance1/spurious_syscall_crash
FEXCore/OpcodeDispatcher: Fix a spurious crash that can occur with multiblock
This commit is contained in:
2 files changed
+24
-1
No files matched your search
@@ -4510,7 +4510,9 @@ void OpDispatchBuilder::INTOp(OpcodeArgs) {
|
||||
constexpr uint8_t SYSCALL_LITERAL = 0x80;
|
||||
if (Literal == SYSCALL_LITERAL) {
|
||||
if (CTX->Config.Is64BitMode()) [[unlikely]] {
|
||||
ERROR_AND_DIE_FMT("[Unsupported] Trying to execute 32-bit syscall from a 64-bit process.");
|
||||
LogMan::Msg::EFmt("[Unsupported] Trying to execute 32-bit syscall from a 64-bit process.");
|
||||
UnhandledOp(Op);
|
||||
return;
|
||||
}
|
||||
// Syscall on linux
|
||||
SyscallOp(Op, false);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
; FEX-Emu had a bug where an `int 0x80` instruction that never gets executed would cause the emulator to assert.
|
||||
; This was due to multiblock's static analysis finding a 32-bit syscall in some code down a branch that would never execute.
|
||||
; Ensure this doesn't take down the emulator by doing something similar.
|
||||
mov rax, 0
|
||||
cmp rax, 0
|
||||
|
||||
je .end
|
||||
|
||||
mov rax, 1
|
||||
int 0x80
|
||||
|
||||
.end:
|
||||
hlt
|
||||
Reference in new issue
Block a user