qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 6815a8: disas/hppa: Remove dead code


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 6815a8: disas/hppa: Remove dead code
Date: Tue, 07 Mar 2017 09:15:12 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 6815a8a00a8f3fd380fb5f87b934694c78d20ec4
      
https://github.com/qemu/qemu/commit/6815a8a00a8f3fd380fb5f87b934694c78d20ec4
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M disas/hppa.c

  Log Message:
  -----------
  disas/hppa: Remove dead code

Coverity complains (CID 1302705) that the "fr0" part of the ?: in
fput_fp_reg_r() is dead.  This looks like cut-n-paste error from
fput_fp_reg(); delete the dead code.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden


  Commit: 3f168b5d353fa68baab55ea0c6ba791f0df027dc
      
https://github.com/qemu/qemu/commit/3f168b5d353fa68baab55ea0c6ba791f0df027dc
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M disas/i386.c

  Log Message:
  -----------
  disas/i386: Avoid NULL pointer dereference in error case

In a code path where we hit an internal disassembler error, execution
would subsequently attempt to dereference a NULL pointer.  This
should never happen, but avoid the crash.

Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden


  Commit: 2e3883d03df167b15f2acc5345eb9a7e0150a062
      
https://github.com/qemu/qemu/commit/2e3883d03df167b15f2acc5345eb9a7e0150a062
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M disas/m68k.c

  Log Message:
  -----------
  disas/m68k: Avoid unintended sign extension in get_field()

In get_field(), we take an 'unsigned char' value and shift it left,
which implicitly promotes it to 'signed int', before ORing it into an
'unsigned long' type.  If 'unsigned long' is 64 bits then this will
result in a sign extension and the top 32 bits of the result will be
1s.  Add explicit casts to unsigned long before shifting to prevent
this.

(Spotted by Coverity, CID 715697.)

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-id: address@hidden


  Commit: 1d153a3388b150b8aeedde32242db86b79c45473
      
https://github.com/qemu/qemu/commit/1d153a3388b150b8aeedde32242db86b79c45473
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M disas/microblaze.c

  Log Message:
  -----------
  disas/microblaze: Avoid unintended sign extension

In read_insn_microblaze() we assemble 4 bytes into an 'unsigned
long'.  If 'unsigned long' is 64 bits and the high byte has its top
bit set, then C's implicit conversion from 'unsigned char' to 'int'
for the shift will result in an unintended sign extension which sets
the top 32 bits in 'inst'.  Add casts to prevent this.  (Spotted by
Coverity, CID 1005401.)

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Message-id: address@hidden


  Commit: 001ebaca7b1120233e04c38f3e3ad3f377137c69
      
https://github.com/qemu/qemu/commit/001ebaca7b1120233e04c38f3e3ad3f377137c69
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M disas/cris.c

  Log Message:
  -----------
  disas/cris: Avoid unintended sign extension

In the cris disassembler we were using 'unsigned long' to calculate
addresses which are supposed to be 32 bits.  This meant that we might
accidentally sign extend or calculate a value that was outside the 32
bit range of the guest CPU.  Use 'uint32_t' instead so we give the
right answers on 64-bit hosts.

(Spotted by Coverity, CID 1005402, 1005403.)

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden


  Commit: 43c227f9dd7945bb4a895f841ecdb957bd8a12da
      
https://github.com/qemu/qemu/commit/43c227f9dd7945bb4a895f841ecdb957bd8a12da
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M disas/arm.c

  Log Message:
  -----------
  disas/arm: Avoid unintended sign extension

When assembling 'given' from the instruction bytes, C's integer
promotion rules mean we may promote an unsigned char to a signed
integer before shifting it, and then sign extend to a 64-bit long,
which can set the high bits of the long.  The code doesn't in fact
care about the high bits if the long is 64 bits, but this is
surprising, so don't do it.

(Spotted by Coverity, CID 1005404.)

Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden


Compare: https://github.com/qemu/qemu/compare/ff79d5e939c3...43c227f9dd79

reply via email to

[Prev in Thread] Current Thread [Next in Thread]