mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 22:15:17 -04:00
ams: revamp assertion system
This commit is contained in:
parent
9572fb2ce3
commit
40400aee1f
168 changed files with 1014 additions and 696 deletions
|
@ -161,11 +161,11 @@ namespace ams::sm::impl {
|
|||
cfg::GetInitialProcessRange(&this->min, &this->max);
|
||||
|
||||
/* Ensure range is sane. */
|
||||
AMS_ASSERT(this->min <= this->max);
|
||||
AMS_ABORT_UNLESS(this->min <= this->max);
|
||||
}
|
||||
|
||||
bool IsInitialProcess(os::ProcessId process_id) const {
|
||||
AMS_ASSERT(process_id != os::InvalidProcessId);
|
||||
AMS_ABORT_UNLESS(process_id != os::InvalidProcessId);
|
||||
return this->min <= process_id && process_id <= this->max;
|
||||
}
|
||||
};
|
||||
|
@ -228,7 +228,7 @@ namespace ams::sm::impl {
|
|||
void GetMitmProcessInfo(MitmProcessInfo *out_info, os::ProcessId process_id) {
|
||||
/* Anything that can request a mitm session must have a process info. */
|
||||
const auto process_info = GetProcessInfo(process_id);
|
||||
AMS_ASSERT(process_info != nullptr);
|
||||
AMS_ABORT_UNLESS(process_info != nullptr);
|
||||
|
||||
/* Write to output. */
|
||||
out_info->process_id = process_id;
|
||||
|
@ -383,7 +383,7 @@ namespace ams::sm::impl {
|
|||
GetMitmProcessInfo(&client_info, process_id);
|
||||
if (!IsMitmDisallowed(client_info.program_id)) {
|
||||
/* We're mitm'd. Assert, because mitm service host dead is an error state. */
|
||||
R_ASSERT(GetMitmServiceHandleImpl(out, service_info, client_info));
|
||||
R_ABORT_UNLESS(GetMitmServiceHandleImpl(out, service_info, client_info));
|
||||
return ResultSuccess();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue