MAX_PILS is the array size, which makes it an invalid index; we really want the range 0..MAX_PILS-1 instead of 1..MAX_PILS. For some reason bit 0 is always 0 in the code so will never have an effect, but that may be a (separate) bug. This fixes a build failure on Ubuntu 10.10 armel. I have no idea why the compiler didn't complain on other architectures as well. --- slavio_intctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c index fd69354..ac950ca 100644 --- a/hw/slavio_intctl.c +++ b/hw/slavio_intctl.c @@ -289,7 +289,7 @@ pil_pending |= (s->slaves[i].intreg_pending & CPU_SOFTIRQ_MASK) >> 16; if (set_irqs) { - for (j = MAX_PILS; j > 0; j--) { + for (j = MAX_PILS-1; j >= 0; j--) { if (pil_pending & (1 << j)) { if (!(s->slaves[i].irl_out & (1 << j))) { qemu_irq_raise(s->cpu_irqs[i][j]); -- bzr 2.3b5, bzr-git 0.5.3, dulwich 0.7.0