From: John Baldwin <jhb@FreeBSD.org>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Make pascal_language::print_type handle varstring==nullptr
Date: Thu, 28 Mar 2024 13:25:29 -0400 [thread overview]
Message-ID: <155f231f-eaed-41ac-a131-9bf756085e1a@FreeBSD.org> (raw)
In-Reply-To: <20240327164031.1582317-1-tom@tromey.com>
On 3/27/24 12:40 PM, Tom Tromey wrote:
> PR gdb/31524 points out a crash when pascal_language::print_type is
> called with varstring==nullptr. This crash is a regression arising
> from the printf/pager rewrite -- that indirectly removed a NULL check
> from gdb's "puts".
>
> This patch instead fixes the problem by adding a check to print_type.
> Passing nullptr here seems to be expected in other places (e.g., there
> is a call to type_print like this in expprint.c), and other
> implementations of this method (or related helpers) explicitly check
> for NULL.
>
> I didn't write a test case for this because it seemed like overkill
> for a Pascal bug that only occurs with -i=mi. However, if you want
> one, let me know and I will do it.
>
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31524
Seems obvious to me. I think it's fine without a test case.
Approved-By: John Baldwin <jhb@FreeBSD.org>
--
John Baldwin
prev parent reply other threads:[~2024-03-28 17:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 16:40 Tom Tromey
2024-03-28 17:25 ` John Baldwin [this message]
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=155f231f-eaed-41ac-a131-9bf756085e1a@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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