From 519fb35c5fbdf61552e9bf07f136210da345925f Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Fri, 16 Jun 2023 14:22:29 +0300 Subject: [PATCH] Less UB --- src/core/PICA/dynapica/shader_rec_emitter_x64.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp b/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp index 74da2a52..596dcb02 100644 --- a/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp +++ b/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp @@ -781,7 +781,8 @@ void ShaderEmitter::recLOOP(const PICAShader& shader, u32 instruction) { loopLevel++; // Offset of the uniform - const uintptr_t uniformOffset = uintptr_t(&shader.intUniforms[uniformIndex]) - uintptr_t(&shader); + const auto& uniform = shader.intUniforms[uniformIndex]; + const uintptr_t uniformOffset = uintptr_t(&uniform[0]) - uintptr_t(&shader); // Offset of the loop register const uintptr_t loopRegOffset = uintptr_t(&shader.loopCounter) - uintptr_t(&shader);