mirror of
				https://github.com/hedge-dev/XenonRecomp.git
				synced 2025-11-03 22:37:09 +00:00 
			
		
		
		
	Fix return value from longjmp getting forgotten after setjmp. (#122)
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:
		@@ -378,8 +378,9 @@ bool Recompiler::Recompile(
 | 
			
		||||
            else if (address == config.setJmpAddress)
 | 
			
		||||
            {
 | 
			
		||||
                println("\t{} = ctx;", env());
 | 
			
		||||
                println("\t{}.s64 = setjmp(*reinterpret_cast<jmp_buf*>(base + {}.u32));", r(3), r(3));
 | 
			
		||||
                println("\tif ({}.s64 != 0) ctx = {};", r(3), env());
 | 
			
		||||
                println("\t{}.s64 = setjmp(*reinterpret_cast<jmp_buf*>(base + {}.u32));", temp(), r(3));
 | 
			
		||||
                println("\tif ({}.s64 != 0) ctx = {};", temp(), env());
 | 
			
		||||
                println("\t{} = {};", r(3), temp());
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user