Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFC: missing do_cleanups call in dwarf2_frame_cache
Date: Thu, 02 Aug 2012 16:08:00 -0000	[thread overview]
Message-ID: <87vch1qntm.fsf@fleche.redhat.com> (raw)

While debugging a different problem, I found a spot in
dwarf2_frame_cache that fails to call do_cleanups before returning.  The
usual rule is that ordinary functions should not leave any dangling
cleanups.

Built and regtested on x86-64 Fedora 16.

Tom

	* dwarf2-frame.c (dwarf2_frame_cache): Call do_cleanups before
	return.
---
 gdb/dwarf2-frame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 01786ef..741a103 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1110,6 +1110,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
       if (ex.error == NOT_AVAILABLE_ERROR)
 	{
 	  cache->unavailable_retaddr = 1;
+	  do_cleanups (old_chain);
 	  return cache;
 	}
 
-- 
1.7.7.6


             reply	other threads:[~2012-08-02 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 16:08 Tom Tromey [this message]
2012-08-02 16:33 ` Pedro Alves

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=87vch1qntm.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --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