summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-22 21:42:05 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-23 14:40:09 +0100
commit8013fcadd975d5e72e86afd96de41feaca42a23a (patch)
tree5150142c9ee2133a578bd10ef8a851dbedc83179 /tools
parent4c91770dde40d248af736436716994dc367a54a2 (diff)
cid#1471704 Assignment of overlapping memory
overlapping_assignment: Assigning (*this).nNum[0] to (*this).nVal, which have overlapping memory locations and different types. Change-Id: I70d7236af27bf5399ad5eb5553befd2eb33e37db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161202 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/bigint.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index 240494dfc15d..80b86af6013c 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -76,14 +76,15 @@ void BigInt::Normalize()
{
constexpr sal_uInt32 maxForPosInt32 = std::numeric_limits<sal_Int32>::max();
constexpr sal_uInt32 maxForNegInt32 = -sal_Int64(std::numeric_limits<sal_Int32>::min());
- if (bIsNeg && nNum[0] <= maxForNegInt32)
+ sal_uInt32 nNum0 = nNum[0];
+ if (bIsNeg && nNum0 <= maxForNegInt32)
{
- nVal = -sal_Int64(nNum[0]);
+ nVal = -sal_Int64(nNum0);
nLen = 0;
}
- else if (!bIsNeg && nNum[0] <= maxForPosInt32)
+ else if (!bIsNeg && nNum0 <= maxForPosInt32)
{
- nVal = nNum[0];
+ nVal = nNum0;
nLen = 0;
}
}