This is the mail archive of the archer@sourceware.org mailing list for the Archer 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]

[charset] [commit] Fix a crash on gdb.ada/packed_array.exp onwrongly read Ada type.


commit 7d1f783d55d1ac0d56b764aea18aeb22cba88e9b

Due to the change f0fab6ed91c0d78127a52afc1965003efe5e64f5 which started to
create new `struct symbol's even for `typedef's and Ada support is wrongly
missing CHECK_TYPEDEFs the Ada support could also crash on a NULL dereference.

	* ada-typeprint.c (print_array_type): Do the NULL check unconditionally.
---
 gdb/ada-typeprint.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index f00824a..ef665c4 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -357,16 +357,17 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
   bitsize = 0;
   fprintf_filtered (stream, "array (");
 
+  if (type == NULL)
+    {
+      fprintf_filtered (stream, _("<undecipherable array type>"));
+      return;
+    }
+
   n_indices = -1;
   if (show < 0)
     fprintf_filtered (stream, "...");
   else
     {
-      if (type == NULL)
-        {
-          fprintf_filtered (stream, _("<undecipherable array type>"));
-          return;
-        }
       if (ada_is_simple_array_type (type))
 	{
 	  struct type *range_desc_type =
-- 
1.6.0.6


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