linker: More null check
This commit is contained in:
parent
4846704832
commit
3a80df007e
|
@ -68,8 +68,10 @@ void Linker::Execute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure used flexible memory size.
|
// Configure used flexible memory size.
|
||||||
if (u64* flexible_size = GetProcParam()->mem_param->flexible_memory_size) {
|
if (auto* mem_param = GetProcParam()->mem_param) {
|
||||||
memory->SetTotalFlexibleSize(*flexible_size);
|
if (u64* flexible_size = mem_param->flexible_memory_size) {
|
||||||
|
memory->SetTotalFlexibleSize(*flexible_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init primary thread.
|
// Init primary thread.
|
||||||
|
|
|
@ -206,9 +206,15 @@ int MemoryManager::QueryProtection(VAddr addr, void** start, void** end, u32* pr
|
||||||
const auto& vma = it->second;
|
const auto& vma = it->second;
|
||||||
ASSERT_MSG(vma.type != VMAType::Free, "Provided address is not mapped");
|
ASSERT_MSG(vma.type != VMAType::Free, "Provided address is not mapped");
|
||||||
|
|
||||||
*start = reinterpret_cast<void*>(vma.base);
|
if (start != nullptr) {
|
||||||
*end = reinterpret_cast<void*>(vma.base + vma.size);
|
*start = reinterpret_cast<void*>(vma.base);
|
||||||
*prot = static_cast<u32>(vma.prot);
|
}
|
||||||
|
if (end != nullptr) {
|
||||||
|
*end = reinterpret_cast<void*>(vma.base + vma.size);
|
||||||
|
}
|
||||||
|
if (prot != nullptr) {
|
||||||
|
*prot = static_cast<u32>(vma.prot);
|
||||||
|
}
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue