From 262f92900d899c61c7de385014cddaeaf28fc343 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 8 Jan 2023 21:05:54 +0000 Subject: [PATCH] Ensure unmapped VMM ranges return an invalid span --- app/src/main/cpp/skyline/common/address_space.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/common/address_space.h b/app/src/main/cpp/skyline/common/address_space.h index 2a70ab34..c7f34d16 100644 --- a/app/src/main/cpp/skyline/common/address_space.h +++ b/app/src/main/cpp/skyline/common/address_space.h @@ -156,7 +156,7 @@ namespace skyline { auto [blockSpan, rangeOffset]{LookupBlockLocked(virt, cpuAccessCallback)}; if (blockSpan.size() - rangeOffset >= size) { TranslatedAddressRange ranges; - ranges.push_back(blockSpan.subspan(rangeOffset, size)); + ranges.push_back(blockSpan.subspan(blockSpan.valid() ? rangeOffset : 0, size)); return ranges; }