summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Markus Wick2021-06-10 21:07:27 +0200
committerGravatar Markus Wick2021-06-10 21:07:27 +0200
commit6755025310335abdb655c11fc65801fee99bb3d9 (patch)
tree6e4dd0bc6f2feb5e10ac6f101883fd9cfaa27be5 /src/core/file_sys
parenthle: service: Increase arbitrary max sessions limit. (diff)
downloadyuzu-6755025310335abdb655c11fc65801fee99bb3d9.tar.gz
yuzu-6755025310335abdb655c11fc65801fee99bb3d9.tar.xz
yuzu-6755025310335abdb655c11fc65801fee99bb3d9.zip
Fix GCC undefined behavior sanitizer.
* Wrong alignment in u64 LOG_DEBUG -> memcpy. * Huge shift exponent in stride calculation for linear buffer, unused result -> skipped. * Large shift in buffer cache if word = 0, skip checking for set bits. Non of those were critical, so this should not change any behavior. At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/program_metadata.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp
index 83b83a044..01ae1a567 100644
--- a/src/core/file_sys/program_metadata.cpp
+++ b/src/core/file_sys/program_metadata.cpp
@@ -150,7 +150,9 @@ void ProgramMetadata::Print() const {
150 LOG_DEBUG(Service_FS, " > Is Retail: {}", acid_header.is_retail ? "YES" : "NO"); 150 LOG_DEBUG(Service_FS, " > Is Retail: {}", acid_header.is_retail ? "YES" : "NO");
151 LOG_DEBUG(Service_FS, "Title ID Min: 0x{:016X}", acid_header.title_id_min); 151 LOG_DEBUG(Service_FS, "Title ID Min: 0x{:016X}", acid_header.title_id_min);
152 LOG_DEBUG(Service_FS, "Title ID Max: 0x{:016X}", acid_header.title_id_max); 152 LOG_DEBUG(Service_FS, "Title ID Max: 0x{:016X}", acid_header.title_id_max);
153 LOG_DEBUG(Service_FS, "Filesystem Access: 0x{:016X}\n", acid_file_access.permissions); 153 u64_le permissions_l; // local copy to fix alignment error
154 std::memcpy(&permissions_l, &acid_file_access.permissions, sizeof(permissions_l));
155 LOG_DEBUG(Service_FS, "Filesystem Access: 0x{:016X}\n", permissions_l);
154 156
155 // Begin ACI0 printing (actual perms, unsigned) 157 // Begin ACI0 printing (actual perms, unsigned)
156 LOG_DEBUG(Service_FS, "Magic: {:.4}", aci_header.magic.data()); 158 LOG_DEBUG(Service_FS, "Magic: {:.4}", aci_header.magic.data());