Fix return value from longjmp getting forgotten after setjmp. ()

Restoring env to ctx was causing this because the return value was getting assigned to r3 before the if check.
This commit is contained in:
Skyth (Asilkan) 2025-03-21 17:38:08 +03:00 committed by GitHub
parent c3934c624f
commit 82b4cd3bb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -378,8 +378,9 @@ bool Recompiler::Recompile(
else if (address == config.setJmpAddress) else if (address == config.setJmpAddress)
{ {
println("\t{} = ctx;", env()); println("\t{} = ctx;", env());
println("\t{}.s64 = setjmp(*reinterpret_cast<jmp_buf*>(base + {}.u32));", r(3), r(3)); println("\t{}.s64 = setjmp(*reinterpret_cast<jmp_buf*>(base + {}.u32));", temp(), r(3));
println("\tif ({}.s64 != 0) ctx = {};", r(3), env()); println("\tif ({}.s64 != 0) ctx = {};", temp(), env());
println("\t{} = {};", r(3), temp());
} }
else else
{ {