summaryrefslogtreecommitdiff
path: root/include/ibm/locks.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/ibm/locks.hpp')
-rw-r--r--include/ibm/locks.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index 4fbb50360d..5a86d09dec 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -535,9 +535,14 @@ inline bool Lock::checkByte(uint64_t resourceId1, uint64_t resourceId2,
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
uint8_t* q = reinterpret_cast<uint8_t*>(&resourceId2);
- BMCWEB_LOG_DEBUG << "Comparing bytes " << std::to_string(p[position]) << ","
- << std::to_string(q[position]);
- if (p[position] != q[position])
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+ uint8_t pPosition = p[position];
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+ uint8_t qPosition = q[position];
+
+ BMCWEB_LOG_DEBUG << "Comparing bytes " << std::to_string(pPosition) << ","
+ << std::to_string(qPosition);
+ if (pPosition != qPosition)
{
return false;
}