public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Henderson, Stuart" <Stuart.Henderson@analog.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix PR target/48807
Date: Thu, 19 May 2011 13:08:00 -0000	[thread overview]
Message-ID: <05E9E85E39C35B4D96ED3A3190E35A10A49CDA1888@LIMKCMBX1.ad.analog.com> (raw)

Ping
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00503.html


Hi,
The attached patch is a fix for PR/48807, which is a segfault when compiling the bfin compiler.  The problem appears to be that we're not checking the return value of cgraph_local_info for null before attempting to dereference it.  This wasn't a problem before, but now cgraph_local_info calls cgraph_get_node (instead of the old cgraph_node), we cannot assume it will always return non-null.

Fix is in bfin specific code.

Ok to commit to trunk?

Stu


2011-05-06  Stuart Henderson  <shenders@gcc.gnu.org>

    * config/bfin/bfin.c: Check return value of cgraph_local_info for null before
        attempting to use it.




Index: gcc/config/bfin/bfin.c
===================================================================
--- gcc/config/bfin/bfin.c      (revision 173363)
+++ gcc/config/bfin/bfin.c      (working copy)
@@ -2077,6 +2077,8 @@

   this_func = cgraph_local_info (current_function_decl);
   called_func = cgraph_local_info (decl);
+  if (!called_func || !this_func)
+    return false;
   return !called_func->local || this_func->local;
 }


             reply	other threads:[~2011-05-19 12:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 13:08 Henderson, Stuart [this message]
2011-05-26 11:02 ` Henderson, Stuart
2011-05-26 13:46 ` Bernd Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2011-05-06 10:57 Henderson, Stuart

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=05E9E85E39C35B4D96ED3A3190E35A10A49CDA1888@LIMKCMBX1.ad.analog.com \
    --to=stuart.henderson@analog.com \
    --cc=gcc-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).