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,9 +71,10 @@ static void update_irq(struct xlx_pic *p)
|
|||||||
|
|
||||||
/* Update the vector register. */
|
/* Update the vector register. */
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (p->regs[R_IPR] & (1 << i))
|
if (p->regs[R_IPR] & (1U << i)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (i == 32)
|
if (i == 32)
|
||||||
i = ~0;
|
i = ~0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user