summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-01-09 08:23:43 +0100
committerbunnei <bunneidev@gmail.com>2022-01-12 01:28:11 +0100
commit6ac44f3bdca29c3b0530aa600b914c5952e525f3 (patch)
tree9eec1c9b3d882c440df2fa152bb9aff94f3c7bbe /src/core
parenthle: kernel: k_page_table: ReadAndWrite -> UserReadWrite. (diff)
downloadyuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.tar
yuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.tar.gz
yuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.tar.bz2
yuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.tar.lz
yuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.tar.xz
yuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.tar.zst
yuzu-6ac44f3bdca29c3b0530aa600b914c5952e525f3.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/ldr/ldr.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index 061358863..28d8114c5 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -530,9 +530,13 @@ public:
ResultCode UnmapNro(const NROInfo& info) {
// Each region must be unmapped separately to validate memory state
auto& page_table{system.CurrentProcess()->PageTable()};
- CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address + info.text_size + info.ro_size +
- info.data_size,
- info.bss_address, info.bss_size));
+
+ if (info.bss_size != 0) {
+ CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address + info.text_size +
+ info.ro_size + info.data_size,
+ info.bss_address, info.bss_size));
+ }
+
CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address + info.text_size + info.ro_size,
info.src_addr + info.text_size + info.ro_size,
info.data_size));