aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/query_cache.h
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-07-26 10:33:28 -0400
committerGitHub <noreply@github.com>2023-07-26 10:33:28 -0400
commita28a0c47f85da1768c1fcab73b06c8e2bee96bcd (patch)
treeab5c72b17b15185ec40945c5ba29400569b50630 /src/video_core/query_cache.h
parenta9b733893c6862124de9eac2d0226e1b3f36c637 (diff)
parent85d77f636c7ab28ea67c4c303f5d85b063ceed73 (diff)
Merge pull request #10990 from comex/ubsan
Fixes and workarounds to make UBSan happier on macOS
Diffstat (limited to 'src/video_core/query_cache.h')
-rw-r--r--src/video_core/query_cache.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h
index 1528cc1dd8..7047e2e631 100644
--- a/src/video_core/query_cache.h
+++ b/src/video_core/query_cache.h
@@ -103,7 +103,9 @@ public:
explicit QueryCacheBase(VideoCore::RasterizerInterface& rasterizer_,
Core::Memory::Memory& cpu_memory_)
: rasterizer{rasterizer_},
- cpu_memory{cpu_memory_}, streams{{CounterStream{static_cast<QueryCache&>(*this),
+ // Use reinterpret_cast instead of static_cast as workaround for
+ // UBSan bug (https://github.com/llvm/llvm-project/issues/59060)
+ cpu_memory{cpu_memory_}, streams{{CounterStream{reinterpret_cast<QueryCache&>(*this),
VideoCore::QueryType::SamplesPassed}}} {
(void)slot_async_jobs.insert(); // Null value
}