This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] testsuite/gdb.base/miscexprs.c: fix array bounds violation

This patch fixes PR gdb/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  <>

	* 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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]