diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-01-14 14:31:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-15 08:08:40 +0100 |
commit | 61a3aaae61dfb6d9538eeeed4721d44293d737f4 (patch) | |
tree | 429d0cc39800cb170f0921404f8bd6dddfb4c4b4 /tools | |
parent | f582670131dc211e472960ecff1826f7b133b083 (diff) |
cid#1471704 workaround
Coverity complaints that
"nVal = nNum[0] in bigint.cxx:84 is an assignment of overlapping memory"
But this is essentially a tagged union, so it's actually fine.
Workaround the warning by using a temporary (which the compiler
will optimise away anyhow)
Change-Id: I0fda945f831b1cdd7b33f7cb671a744150990bf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109294
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/bigint.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx index 5c8c7771a2c5..f6627200a61c 100644 --- a/tools/source/generic/bigint.cxx +++ b/tools/source/generic/bigint.cxx @@ -80,14 +80,16 @@ void BigInt::Normalize() if ( nLen < 3 ) { + sal_Int32 newVal; if ( nLen < 2 ) - nVal = nNum[0]; + newVal = nNum[0]; else if ( nNum[1] & 0x8000 ) return; else - nVal = (static_cast<sal_Int32>(nNum[1]) << 16) + nNum[0]; + newVal = (static_cast<sal_Int32>(nNum[1]) << 16) + nNum[0]; nLen = 0; + nVal = newVal; if ( bIsNeg ) nVal = -nVal; |