From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: fix latent bug in syms_from_objfile_1
Date: Thu, 21 Mar 2013 15:36:00 -0000 [thread overview]
Message-ID: <871ub84vo7.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20130321141954.GA10644@host2.jankratochvil.net> (Jan Kratochvil's message of "Thu, 21 Mar 2013 15:19:54 +0100")
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> On Wed, 20 Mar 2013 20:50:10 +0100, Tom Tromey wrote:
>> --- a/gdb/symfile.c
>> +++ b/gdb/symfile.c
Jan> [...]
>> @@ -205,11 +207,14 @@ alloc_section_addr_info (size_t num_sections)
>> struct section_addr_info *sap;
>> size_t size;
>>
>> + /* Make sure the size calculation turns out ok. */
>> + if (num_sections == 0)
>> + ++num_sections;
Jan> I always thought such sizeof calculation works even with # of
Jan> elements == 0. Why not?
It seemed weird to me since it would allocate an object smaller than a
struct section_addr_info.
I don't mind dropping that line though.
Jan> I am OK with the patch, thanks for the cleanup waiting for so many years.
Thanks. I'm going to put it in today, since it is actively messing up
my regression tests.
Tom
next prev parent reply other threads:[~2013-03-21 15:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 18:23 Tom Tromey
2013-03-20 19:06 ` Jan Kratochvil
2013-03-20 19:53 ` Tom Tromey
2013-03-21 14:41 ` Jan Kratochvil
2013-03-21 15:36 ` Tom Tromey [this message]
2013-03-21 16:08 ` Jan Kratochvil
2013-03-21 17:39 ` 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=871ub84vo7.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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