This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] ada-valprint.c (ada_val_print_array): Assert elttype not null.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Joel Brobecker <brobecker at adacore dot com>
- Date: Fri, 04 Mar 2011 14:29:59 -0800
- Subject: [RFA] ada-valprint.c (ada_val_print_array): Assert elttype not null.
If we pass null to printstr, it will dereference it.
OK?
2011-03-04 Michael Snyder <msnyder@vmware.com>
* ada-valprint.c (ada_val_print_array): Assert elttype not null.
Index: ada-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-valprint.c,v
retrieving revision 1.80
diff -u -p -r1.80 ada-valprint.c
--- ada-valprint.c 14 Feb 2011 11:23:33 -0000 1.80
+++ ada-valprint.c 4 Mar 2011 22:27:03 -0000
@@ -644,6 +644,7 @@ ada_val_print_array (struct type *type,
len = temp_len;
}
+ gdb_assert (elttype);
printstr (stream, elttype, valaddr + offset, len, 0, eltlen, options);
result = len;
}