hw/intc/xilinx_intc: Avoid shifting left into sign bit
Avoid undefined behaviour shifting left into the sign bit. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
7d45e78401
commit
0bc60bd7b3
|
@ -71,8 +71,9 @@ static void update_irq(struct xlx_pic *p)
|
|||
|
||||
/* Update the vector register. */
|
||||
for (i = 0; i < 32; i++) {
|
||||
if (p->regs[R_IPR] & (1 << i))
|
||||
if (p->regs[R_IPR] & (1U << i)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == 32)
|
||||
i = ~0;
|
||||
|
|
Loading…
Reference in a new issue