summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2021-06-10 22:17:33 -0700
committerGravatar GitHub2021-06-10 22:17:33 -0700
commit46ec0ee55b5820a517f251780c908cff5fcd1c13 (patch)
treeb8639614c724fb83f959e50da8608236b0210ebf /src
parentMerge pull request #6444 from bunnei/fix-sm-sessions (diff)
parentFix GCC undefined behavior sanitizer. (diff)
downloadyuzu-46ec0ee55b5820a517f251780c908cff5fcd1c13.tar.gz
yuzu-46ec0ee55b5820a517f251780c908cff5fcd1c13.tar.xz
yuzu-46ec0ee55b5820a517f251780c908cff5fcd1c13.zip
Merge pull request #6445 from degasus/fix_ubsn
Fix GCC undefined behavior sanitizer.
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/program_metadata.cpp4
-rw-r--r--src/video_core/buffer_cache/buffer_base.h3
-rw-r--r--src/video_core/texture_cache/util.cpp3
3 files changed, 9 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());
diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h
index 0c00ae280..a39505903 100644
--- a/src/video_core/buffer_cache/buffer_base.h
+++ b/src/video_core/buffer_cache/buffer_base.h
@@ -476,6 +476,9 @@ private:
476 current_size = 0; 476 current_size = 0;
477 on_going = false; 477 on_going = false;
478 } 478 }
479 if (empty_bits == PAGES_PER_WORD) {
480 break;
481 }
479 page += empty_bits; 482 page += empty_bits;
480 483
481 const int continuous_bits = std::countr_one(word >> page); 484 const int continuous_bits = std::countr_one(word >> page);
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index 8c4a5523b..906604a39 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -647,6 +647,9 @@ u32 CalculateLayerSize(const ImageInfo& info) noexcept {
647} 647}
648 648
649LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept { 649LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept {
650 if (info.type == ImageType::Linear) {
651 return {};
652 }
650 ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS)); 653 ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS));
651 const LevelInfo level_info = MakeLevelInfo(info); 654 const LevelInfo level_info = MakeLevelInfo(info);
652 LevelArray offsets{}; 655 LevelArray offsets{};