loader: fix ldr:ro unmap semantics for < 3.0.0

This commit is contained in:
Michael Scire 2019-03-16 19:14:51 -07:00
parent e7f941fa3d
commit db3c5cf20f
2 changed files with 62 additions and 45 deletions

View file

@ -151,13 +151,15 @@ struct MappedCodeMemory {
return rc;
}
void Unmap() {
Result Unmap() {
Result rc = 0;
if (this->IsMapped()) {
if (R_FAILED(svcUnmapProcessMemory(this->mapped_address, this->process_handle, this->code_memory_address, this->size))) {
if (R_FAILED((rc = svcUnmapProcessMemory(this->mapped_address, this->process_handle, this->code_memory_address, this->size)))) {
/* TODO: panic(). */
}
}
this->mapped_address = NULL;
return rc;
}
void Close() {