summaryrefslogtreecommitdiff
path: root/src/core/loader/nso.h
diff options
context:
space:
mode:
authorGravatar Lioncash2018-10-14 21:41:58 -0400
committerGravatar Lioncash2018-10-15 17:02:11 -0400
commitbed872ed38e19d34c6c2e3d1a3d35a9f72e46970 (patch)
tree6533551afe9c5432fa8789a1517a97111d0041c6 /src/core/loader/nso.h
parentnso: Make LoadModule take a VfsFile by const reference (diff)
downloadyuzu-bed872ed38e19d34c6c2e3d1a3d35a9f72e46970.tar.gz
yuzu-bed872ed38e19d34c6c2e3d1a3d35a9f72e46970.tar.xz
yuzu-bed872ed38e19d34c6c2e3d1a3d35a9f72e46970.zip
nso: Return an optional address from LoadModule
If a malformed NSO is attempted to be loaded, we shouldn't continue onwards. We should be reporting an error and bailing out.
Diffstat (limited to 'src/core/loader/nso.h')
-rw-r--r--src/core/loader/nso.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h
index d92897130..433306139 100644
--- a/src/core/loader/nso.h
+++ b/src/core/loader/nso.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <optional>
7#include "common/common_types.h" 8#include "common/common_types.h"
8#include "core/file_sys/patch_manager.h" 9#include "core/file_sys/patch_manager.h"
9#include "core/loader/linker.h" 10#include "core/loader/linker.h"
@@ -36,9 +37,9 @@ public:
36 return IdentifyType(file); 37 return IdentifyType(file);
37 } 38 }
38 39
39 static VAddr LoadModule(const FileSys::VfsFile& file, VAddr load_base, 40 static std::optional<VAddr> LoadModule(const FileSys::VfsFile& file, VAddr load_base,
40 bool should_pass_arguments, 41 bool should_pass_arguments,
41 boost::optional<FileSys::PatchManager> pm = boost::none); 42 std::optional<FileSys::PatchManager> pm = {});
42 43
43 ResultStatus Load(Kernel::Process& process) override; 44 ResultStatus Load(Kernel::Process& process) override;
44}; 45};