qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* target/loongarch: Support QMP dump-guest-memory
       [not found] <a6e35fdd-d8fb-4368-918f-e5f9cdb90105@twiddle.net>
@ 2024-09-13 20:47 ` Richard Henderson
  0 siblings, 0 replies; only message in thread
From: Richard Henderson @ 2024-09-13 20:47 UTC (permalink / raw)
  To: qemu-devel, Bibo Mao


On 9/13/24 11:44, scan-admin@coverity.com wrote:
> ** CID 1561133:  Integer handling issues  (BAD_SHIFT)
> /builds/qemu-project/qemu/target/loongarch/arch_dump.c: 102 in loongarch_write_elf64_fprpreg()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 1561133:  Integer handling issues  (BAD_SHIFT)
> /builds/qemu-project/qemu/target/loongarch/arch_dump.c: 102 in loongarch_write_elf64_fprpreg()
> 96         int ret, i;
> 97
> 98         loongarch_note_init(&note, s, "CORE", 5, NT_PRFPREG, sizeof(note.fpu));
> 99         note.fpu.fcsr = cpu_to_dump64(s, env->fcsr0);
> 100
> 101         for (i = 0; i < 8; i++) {

>>>>      CID 1561133:  Integer handling issues  (BAD_SHIFT)
>>>>      In expression "env->cf[i] << 8 * i", left shifting by more than 31 bits has undefined behavior.  The shift amount, "8 * i", is as much as 56.

> 102             note.fpu.fcc |= env->cf[i] << (8 * i);

Coverity is correct that 'bool' can't be shifted by 56.
However there's an existing read_fcc() that gets this correct.


r~


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-13 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <a6e35fdd-d8fb-4368-918f-e5f9cdb90105@twiddle.net>
2024-09-13 20:47 ` target/loongarch: Support QMP dump-guest-memory Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).