public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: James E Wilson <wilson@specifixinc.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: binutils@sources.redhat.com
Subject: Re: [PATCH] ia64 unwind directive semantics
Date: Fri, 11 Feb 2005 23:15:00 -0000	[thread overview]
Message-ID: <1108151369.19527.24.camel@aretha.corp.specifixinc.com> (raw)
In-Reply-To: <s20ca004.024@emea1-mh.id2.novell.com>

On Fri, 2005-02-11 at 04:08, Jan Beulich wrote:
>Indeed. What lead me to think these aren't, despite their name,
>stack-like was the fact that dot_alias, in its error path, has two
>invocations of obstack_free; according what you say (the later) one
>should be sufficient there...

Yes, an oversight.  We only need one obstack_free call here.

> >If we want to be able to free these strings here, then we can't use
> >obstack to allocate them.
> Perhaps we should.

Or, alternatively, we can use a different obstack than notes.  If we
have an obstack used for dot_rot only, then we know that it will be save
to free everything, and we can do it with one obstack_free call.

> >This one is safe, because we know that there are no other allocations
> on
> >the notes obstack since this string was allocated.
> After you stated the above, it would seem to me that this isn't safe
> either, because there is another (conditional allocation inbetween).
> Thus the order of these two needs to be changed.

If hash_insert fails, then dr did not get allocated to the hash table,
and hence it is OK to free it.  However, looking again, I do see that
there is a possible problem with a dangling pointer.  I believe we can
fix that by moving the "drpp = &dr->next;" assignment after the
hash_insert if statement, and putting "*drpp = NULL;" inside the if
statement.

Your solution of allocating name after dr is also acceptable.

> 	* config/tc-ia64.c (dot_rot): Add comment that name strings
> should
> 	be freed when wiping out previous state. Canonicalize names
> before
> 	use. ...

Thanks.  This is OK.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


       reply	other threads:[~2005-02-11 19:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <s20ca004.024@emea1-mh.id2.novell.com>
2005-02-11 23:15 ` James E Wilson [this message]
2005-02-11 15:58 Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2005-02-02 14:52 Jan Beulich
2005-02-11  1:39 ` James E Wilson
2005-02-02 13:56 Jan Beulich
     [not found] <s1fa08eb.028@emea1-mh.id2.novell.com>
2005-01-29  1:49 ` James E Wilson
2005-01-28  9:43 Jan Beulich
2005-01-24 11:29 Jan Beulich
2005-01-28  3:52 ` James E Wilson
2005-02-02  8:16 ` Alan Modra

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=1108151369.19527.24.camel@aretha.corp.specifixinc.com \
    --to=wilson@specifixinc.com \
    --cc=JBeulich@novell.com \
    --cc=binutils@sources.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).