mirror of
https://git.citron-emu.org/Citron/Citron.git
synced 2025-01-22 08:36:32 +01:00
service-am: Handle panic conditions in SetTerminateResult
- Prevents propagation of panic conditions when setting termination results - Previously, panic error codes could trigger cascading crashes - Only stores non-error termination results while allowing successful completion - Fixes crash when applications set panic-related termination codes (0x1A80A)
This commit is contained in:
parent
6d225eb94a
commit
b574aba98b
1 changed files with 6 additions and 3 deletions
|
@ -181,13 +181,16 @@ Result IApplicationFunctions::GetDesiredLanguage(Out<u64> out_language_code) {
|
|||
}
|
||||
|
||||
Result IApplicationFunctions::SetTerminateResult(Result terminate_result) {
|
||||
LOG_INFO(Service_AM, "(STUBBED) called, result={:#x} ({:04}-{:04})",
|
||||
LOG_INFO(Service_AM, "called, result={:#x} ({:04}-{:04})",
|
||||
terminate_result.GetInnerValue(),
|
||||
static_cast<u32>(terminate_result.GetModule()) + 2000,
|
||||
terminate_result.GetDescription());
|
||||
|
||||
std::scoped_lock lk{m_applet->lock};
|
||||
m_applet->terminate_result = terminate_result;
|
||||
// Only set the terminate result if it's not a panic
|
||||
if (!terminate_result.IsError()) {
|
||||
std::scoped_lock lk{m_applet->lock};
|
||||
m_applet->terminate_result = terminate_result;
|
||||
}
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue