]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
pci/shpc: fix signed integer overflow
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 9 Mar 2015 14:59:46 +0000 (15:59 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 11 Mar 2015 14:59:57 +0000 (15:59 +0100)
commit5820945946b1e221905aa898f2cd97ed825acd47
tree5577b869b705370a50e70091982539cd128ed216
parent92bf484a87882aa23f10412c774a7357b9bd2be0
pci/shpc: fix signed integer overflow

clang undefined behaviour sanitizer reports:
> hw/pci/shpc.c:162:27: runtime error: left shift of 1 by 31 places
> cannot be represented in type 'int'

Caused by the usual lack of a 'U' qualifier on a constant 1 being
shifted left. Fix it up.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/shpc.c