On 03/04/2012 10:39 PM, Peter A. G. Crosthwaite wrote:
Xilinx zynq-7000 machine model. Also includes device model for the zynq-specific
system level control register (SLCR) module.

Signed-off-by: Peter A. G. Crosthwaite<peter.crosthwa...@petalogix.com>
Acked-by: Edgar E. Iglesias<edgar.igles...@gmail.com>

This breaks the build for me:

cc1: warnings being treated as errors
/home/anthony/git/qemu/hw/zynq_slcr.c: In function ‘zynq_slcr_read’:
/home/anthony/git/qemu/hw/zynq_slcr.c:314:25: error: array subscript is above array bounds
/home/anthony/git/qemu/hw/zynq_slcr.c: In function ‘zynq_slcr_write’:
/home/anthony/git/qemu/hw/zynq_slcr.c:457:22: error: array subscript is above array bounds
make[1]: *** [zynq_slcr.o] Error 1


+        case 0xA60 ... 0xA8C:
+            s->afi[0][(offset - 0x700) / 4] = val;
+            break;

And GCC is definitely right here. This will pretty clearly overflow the array if offset is any of the allowable values per the switch statement.

Regards,

Anthony Liguori

Reply via email to