Handle cases when std::optional does not contain a value
This commit is contained in:
parent
d37a2270d6
commit
2306af3600
9 changed files with 15 additions and 7 deletions
|
@ -147,7 +147,9 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
|
|||
|
||||
if (base_address == 0 && target_address == 0) {
|
||||
// Calculate the address at which to map the memory block.
|
||||
target_address = *Memory::PhysicalToVirtualAddress(linear_heap_phys_address);
|
||||
auto maybe_vaddr = Memory::PhysicalToVirtualAddress(linear_heap_phys_address);
|
||||
ASSERT(maybe_vaddr);
|
||||
target_address = *maybe_vaddr;
|
||||
}
|
||||
|
||||
// Map the memory block into the target process
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue