hw/intc/slavio_intctl: Avoid shifting left into sign bit
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 17 Mar 2014 16:00:39 +0000 (16:00 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 27 Mar 2014 15:22:49 +0000 (19:22 +0400)
Add 'U' suffix to avoid undefined behaviour.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/intc/slavio_intctl.c

index 41a1672800da288de45136dfb4c40de612329b5c..b10fb66b8d80ad3ca5092536f8330ae4a4119bb2 100644 (file)
@@ -272,7 +272,7 @@ static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
             CPU_IRQ_TIMER_IN;
         if (i == s->target_cpu) {
             for (j = 0; j < 32; j++) {
-                if ((s->intregm_pending & (1 << j)) && intbit_to_level[j]) {
+                if ((s->intregm_pending & (1U << j)) && intbit_to_level[j]) {
                     s->slaves[i].intreg_pending |= 1 << intbit_to_level[j];
                 }
             }