From 12199b53950a31c530ba661b005acd430a81350c Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Sun, 1 Mar 2026 16:39:00 +0100 Subject: [PATCH] fix: not properly respecting code const array boundaries when dumping techniques --- src/ObjCommon/Techset/CommonTechnique.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ObjCommon/Techset/CommonTechnique.cpp b/src/ObjCommon/Techset/CommonTechnique.cpp index f719d37d..d67d5617 100644 --- a/src/ObjCommon/Techset/CommonTechnique.cpp +++ b/src/ObjCommon/Techset/CommonTechnique.cpp @@ -52,8 +52,9 @@ namespace techset { for (const auto& codeConstSourceInfo : m_code_const_source_infos) { - const auto codeConstSourceInfoEnd = static_cast(codeConstSourceInfo.value) + codeConstSourceInfo.arrayCount; - if (codeConstSourceInfo.value <= codeConstSource && codeConstSourceInfoEnd >= codeConstSource) + const auto arrayCount = std::max(codeConstSourceInfo.arrayCount, 1); + const auto codeConstSourceInfoEnd = static_cast(codeConstSourceInfo.value) + arrayCount; + if (codeConstSourceInfo.value <= codeConstSource && codeConstSourceInfoEnd > codeConstSource) return codeConstSourceInfo; if (codeConstSourceInfoEnd > codeConstSource)