Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] avoid GDB crash on inspection of pascal arrays
@ 2010-03-08 16:55 Pierre Muller
  2010-03-08 18:43 ` Kevin Buettner
  2010-03-08 18:55 ` Joel Brobecker
  0 siblings, 2 replies; 12+ messages in thread
From: Pierre Muller @ 2010-03-08 16:55 UTC (permalink / raw)
  To: gdb-patches

  The is_pascal_string_type function in p-lang.c 
could sometimes be called with an type parameter being NULL.
  This caused crashes in the Free Pascal IDE,
that I finally debugged recently.

  Checked in as pascal language maintainer,

Pierre Muller



ChangeLog entry:

2020-03-08  Pierre Muller  <muller@ics.u-strasbg.fr>

       * p-lang.c (is_pascal_string_type): Check that TYPE arg is non NULL.



Index: p-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/p-lang.c,v
retrieving revision 1.50
diff -u -p -r1.50 p-lang.c
--- p-lang.c    14 Jan 2010 08:03:36 -0000      1.50
+++ p-lang.c    8 Mar 2010 16:49:20 -0000
@@ -101,7 +101,7 @@ is_pascal_string_type (struct type *type
                       struct type **char_type,
                       char **arrayname)
 {
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+  if ((type != NULL) && (TYPE_CODE (type) == TYPE_CODE_STRUCT))
     {
       /* Old Borland type pascal strings from Free Pascal Compiler.  */
       /* Two fields: length and st.  */
 2010-03-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
            Hui Zhu  <teawater@gmail.com>




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-03-09 18:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-08 16:55 [PATCH] avoid GDB crash on inspection of pascal arrays Pierre Muller
2010-03-08 18:43 ` Kevin Buettner
2010-03-08 19:18   ` Pierre Muller
2010-03-08 18:55 ` Joel Brobecker
2010-03-08 23:30   ` Pierre Muller
2010-03-09  5:17     ` Joel Brobecker
2010-03-09  5:17       ` Joel Brobecker
2010-03-09  8:40       ` Pierre Muller
2010-03-09 17:33       ` Eli Zaretskii
2010-03-09 17:56         ` Joel Brobecker
2010-03-09 18:33           ` Eli Zaretskii
2010-03-09 18:33           ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox