From e7c2b054c198bcf7c39a2943f76c866be09aa7d7 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Thu, 10 Jun 2021 21:07:27 +0200 Subject: 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. --- src/video_core/buffer_cache/buffer_base.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/video_core/buffer_cache') diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index 0c00ae280e..a395059036 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -476,6 +476,9 @@ private: current_size = 0; on_going = false; } + if (empty_bits == PAGES_PER_WORD) { + break; + } page += empty_bits; const int continuous_bits = std::countr_one(word >> page); -- cgit v1.2.3