Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [commit] Fix a C++ segfault
Date: Fri, 21 Jul 2006 00:28:00 -0000	[thread overview]
Message-ID: <20060721002757.GA3711@adacore.com> (raw)
In-Reply-To: <20060720225443.GA31345@nevyn.them.org>

Hello Daniel,

> 2006-07-20  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* eval.c (evaluate_struct_tuple): Skip static fields.

I don't know C++ too much - how often is this likely to occur?
Would this be a safe patch for the branch?

Thanks!

> Index: eval.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/eval.c,v
> retrieving revision 1.61
> diff -u -p -r1.61 eval.c
> --- eval.c	18 Feb 2006 20:47:54 -0000	1.61
> +++ eval.c	20 Jul 2006 22:36:01 -0000
> @@ -283,6 +283,10 @@ evaluate_struct_tuple (struct value *str
>  	      if (variantno < 0)
>  		{
>  		  fieldno++;
> +		  /* Skip static fields.  */
> +		  while (fieldno < TYPE_NFIELDS (struct_type)
> +			 && TYPE_FIELD_STATIC_KIND (struct_type, fieldno))
> +		    fieldno++;
>  		  subfieldno = fieldno;
>  		  if (fieldno >= TYPE_NFIELDS (struct_type))
>  		    error (_("too many initializers"));

-- 
Joel


  reply	other threads:[~2006-07-21  0:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20 22:54 Daniel Jacobowitz
2006-07-21  0:28 ` Joel Brobecker [this message]
2006-07-21  0:40   ` Daniel Jacobowitz
2006-07-21  0:43     ` Joel Brobecker

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=20060721002757.GA3711@adacore.com \
    --to=brobecker@adacore.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