This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] testsuite/gdb.base/miscexprs.c: fix array bounds violation
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 3 Jan 2003 22:04:27 -0600
- Subject: [PATCH] testsuite/gdb.base/miscexprs.c: fix array bounds violation
This patch fixes PR gdb/697.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&database=gdb&pr=697
PR gdb/697: buglet in testsuite/gdb.base/miscexprs.c, off-by-1 array reference
The program-under-test had a gratuitous array bounds scribble which
was not meant to be part of the test.
Testing: tested on native i686-pc-linux-gnu, v2 and v3 gcc,
dwarf-2 and stabs+. I saw no differences.
I am committing this as an obvious fix.
Michael C
===
2003-01-03 Michael Chastain <mec@shout.net>
* gdb.base/miscexprs.c: Fix PR gdb/697, "buglet in
testsuite/gdb.base/miscexprs.c, off-by-1 array reference".
===
Index: miscexprs.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/miscexprs.c,v
retrieving revision 1.2
diff -u -r1.2 miscexprs.c
--- miscexprs.c 31 Oct 2001 20:59:22 -0000 1.2
+++ miscexprs.c 4 Jan 2003 04:01:15 -0000
@@ -33,7 +33,7 @@
ibig.i[100] = 5;
cbig.c[0] = '\0';
- cbig.c[100] = 'A';
+ cbig.c[99] = 'A';
fbig.f[100] = 11.99999;
dbig.d[202] = 9.99999999;
sbig.s[90] = 255;