Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] avoid GDB crash on inspection of pascal arrays
Date: Mon, 08 Mar 2010 16:55:00 -0000	[thread overview]
Message-ID: <001801cabee0$31499ca0$93dcd5e0$@muller@ics-cnrs.unistra.fr> (raw)

  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>




             reply	other threads:[~2010-03-08 16:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 16:55 Pierre Muller [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001801cabee0$31499ca0$93dcd5e0$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox