index out of bounds in qemu-0.10.2
Hello,
I am compiling qemu-0.10.2 using the attached autogenerated 'configure' wrapper (if anybody is interested in 'configure' command line options I'm using_.
I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.
While running 'make' I've noticed this:
41 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
42 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 43 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 44 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 45 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
46 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds 47 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds 48 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
.
Once I had the same warnings compiling my own code, and 'gcc' was correct, so most likely it's correct in this case too.
If so, please fix this.
Thanks,
Sergei.
Quoted 20 lines · Sergei Steshenko
Hello,
I am compiling qemu-0.10.2 using the attached autogenerated 'configure' wrapper (if anybody is interested in 'configure' command line options I'm
using_.I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.
While running 'make' I've noticed this:
41
/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
42/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 43/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 44/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 45/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
46/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds 47/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds 48/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
.
Quoted 4 lines
Once I had the same warnings compiling my own code, and 'gcc' was correct, so most likely it's correct in this case too.
If so, please fix this.
My gcc and even sparse is completely silent, strange.
It's because of this area:
uint8_t dcdc[3];
is saved like this:
qemu_put_8s(f, &s->dcdc[3]);
qemu_put_8s(f, &s->dcdc[3]);
qemu_put_8s(f, &s->dcdc[3]);and loaded like this:
qemu_get_8s(f, &s->dcdc[3]);
qemu_get_8s(f, &s->dcdc[3]);
qemu_get_8s(f, &s->dcdc[3]);which is of course wrong.
2009/4/18 Blue Swirl <[email protected]>:
Quoted 38 lines · Sergei Steshenko
Quoted 20 lines
Hello,
I am compiling qemu-0.10.2 using the attached autogenerated 'configure' wrapper (if anybody is interested in 'configure' command line options I'm
using_.I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.
While running 'make' I've noticed this:
41
/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
42/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 43/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 44/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds 45/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
46/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds 47/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds 48/mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds .Quoted 4 lines
Once I had the same warnings compiling my own code, and 'gcc' was correct, so most likely it's correct in this case too.
If so, please fix this.
My gcc and even sparse is completely silent, strange.
It's because of this area:
uint8_t dcdc[3];
is saved like this:
qemu_put_8s(f, &s->dcdc[3]);
qemu_put_8s(f, &s->dcdc[3]);
qemu_put_8s(f, &s->dcdc[3]);
Quoted 5 lines
and loaded like this:
qemu_get_8s(f, &s->dcdc[3]);
qemu_get_8s(f, &s->dcdc[3]);
qemu_get_8s(f, &s->dcdc[3]);
Oops, good catch, I'll correct the indexes.