提交 0bc60bd7 编写于 作者: P Peter Maydell 提交者: Michael Tokarev

hw/intc/xilinx_intc: Avoid shifting left into sign bit

Avoid undefined behaviour shifting left into the sign bit.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 7d45e784
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册