summaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache
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/video_core/buffer_cache
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/video_core/buffer_cache')
-rw-r--r--src/video_core/buffer_cache/buffer_base.h3
1 files changed, 3 insertions, 0 deletions
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);