Hello Luis,
Coverity found a couple of issues which seem related to the DFP patchset.
Could you please take a look ?
Thanks,
C.
-------- Forwarded Message --------
Subject: New Defects reported by Coverity Scan for QEMU
Date: Tue, 9 Nov 2021 22:09:40 +0000
From: scan-admin@coverity.com
To: clg@kaod.org
Hi,
Please find the latest report on new defect(s) introduced to QEMU found
with Coverity Scan.
16 new defect(s) introduced to QEMU found with Coverity Scan.
19 defect(s), reported by Coverity Scan earlier, were marked fixed in
the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 16 of 16 defect(s)
** CID 1465791: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________
*** CID 1465791: Uninitialized variables (UNINIT)
/qemu/target/ppc/dfp_helper.c: 1202 in helper_DENBCD()
1196
} \
1197
dfp_finalize_decimal##size(&dfp); \
1198
dfp_set_FPRF_from_FRT(&dfp); \
1199 set_dfp##size(t,
&dfp.vt); \
1200 }
1201
CID 1465791: Uninitialized variables (UNINIT)
Using uninitialized element of array "dfp.vt" when calling
"set_dfp64".
1202 DFP_HELPER_ENBCD(DENBCD, 64)
1203 DFP_HELPER_ENBCD(DENBCDQ, 128)
** CID 1465787: (BAD_SHIFT)
/qemu/target/ppc/int_helper.c: 369 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 370 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 356 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 356 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 356 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 369 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 370 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 370 in helper_CFUGED()
/qemu/target/ppc/int_helper.c: 369 in helper_CFUGED()
________________________________________________________________________________________________________
*** CID 1465787: (BAD_SHIFT)
/qemu/target/ppc/int_helper.c: 369 in helper_CFUGED()
363 /*
364 * Discards the processed bits from 'src' and 'mask'.
Note that we are
365 * removing 'n' trailing zeros from 'mask', but the
logical shift will
366 * add 'n' leading zeros back, so the population count
of 'mask' is kept
367 * the same.
368 */
CID 1465787: (BAD_SHIFT)
In expression "src >>= n", right shifting by more than 63 bits
has undefined behavior. The shift amount, "n", is as much as 64.