mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2026-03-11 21:15:39 +00:00
hle: cheats: Prevent NullRef and throw a TamperCompilationException instead
for null base instruction byte arrays on the current block in EndConditionalBlock
This commit is contained in:
parent
042362ee2b
commit
56e6339553
2 changed files with 4 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Tamper
|
||||||
Logger.Error?.Print(LogClass.TamperMachine, ex.ToString());
|
Logger.Error?.Print(LogClass.TamperMachine, ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Error?.Print(LogClass.TamperMachine, "There was a problem while compiling the Atmosphere cheat");
|
Logger.Error?.Print(LogClass.TamperMachine, $"There was a problem while compiling the Atmosphere cheat '{name}'");
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ namespace Ryujinx.HLE.HOS.Tamper
|
||||||
DebugLog.Emit(instruction, context);
|
DebugLog.Emit(instruction, context);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new TamperCompilationException($"Code type {codeType} not implemented in Atmosphere cheat");
|
throw new TamperCompilationException($"Code type {codeType} not implemented in Atmosphere cheat compiler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@ namespace Ryujinx.HLE.HOS.Tamper.CodeEmitters
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the conditional begin instruction stored in the stack.
|
// Use the conditional begin instruction stored in the stack.
|
||||||
byte[] upperInstruction = context.CurrentBlock.BaseInstruction;
|
byte[] upperInstruction = context.CurrentBlock.BaseInstruction
|
||||||
|
?? throw new TamperCompilationException($"Base instruction in current block was null; termination type '{terminationType}'");
|
||||||
CodeType codeType = InstructionHelper.GetCodeType(upperInstruction);
|
CodeType codeType = InstructionHelper.GetCodeType(upperInstruction);
|
||||||
|
|
||||||
// Pop the current block of operations from the stack so control instructions
|
// Pop the current block of operations from the stack so control instructions
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue