public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* In pt.c, find_parameter_packs_r, should TYPE_P(t) assure TYPE_CONTEXT(t)?
@ 2009-08-03 12:14 Larry Evans
  2009-08-03 19:39 ` Jason Merrill
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Evans @ 2009-08-03 12:14 UTC (permalink / raw)
  To: gcc

While trying to track down the cause of:

   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40092

I encountered what may be an error.  In pt.c around
line 2493, there's this:

>   if (TYPE_P (t) )
>     cp_walk_tree (&TYPE_CONTEXT (t), 
> 		  &find_parameter_packs_r, ppd, ppd->visited);

However, gdb shows TYPE_CONTEXT(t) is the constant, 0, during
compile of src.cpp:

> http://gcc.gnu.org/bugzilla/attachment.cgi?id=18288

To avoid this, should the if condition be changed to:

> if (TYPE_P (t) && TYPE_CONTEXT(t) )

or is TYPE_CONTEXT(t) == 0 possibly caused by a bug elsewhere?

TIA.

-Larry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: In pt.c, find_parameter_packs_r, should TYPE_P(t) assure TYPE_CONTEXT(t)?
  2009-08-03 12:14 In pt.c, find_parameter_packs_r, should TYPE_P(t) assure TYPE_CONTEXT(t)? Larry Evans
@ 2009-08-03 19:39 ` Jason Merrill
  2009-08-03 20:08   ` Jason Merrill
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Merrill @ 2009-08-03 19:39 UTC (permalink / raw)
  To: Larry Evans; +Cc: gcc

On 08/03/2009 08:32 AM, Larry Evans wrote:
> While trying to track down the cause of:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40092
>
> I encountered what may be an error. In pt.c around
> line 2493, there's this:
>
>> if (TYPE_P (t) )
>> cp_walk_tree (&TYPE_CONTEXT (t), &find_parameter_packs_r, ppd, ppd->visited);
>
> However, gdb shows TYPE_CONTEXT(t) is the constant, 0, during
> compile of src.cpp:

That's not a problem; if the tree passed to walk_tree_1 is null, it just 
returns.

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: In pt.c, find_parameter_packs_r, should TYPE_P(t) assure TYPE_CONTEXT(t)?
  2009-08-03 19:39 ` Jason Merrill
@ 2009-08-03 20:08   ` Jason Merrill
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Merrill @ 2009-08-03 20:08 UTC (permalink / raw)
  To: gcc; +Cc: gcc

On 08/03/2009 08:32 AM, Larry Evans wrote:
> While trying to track down the cause of:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40092
>
> I encountered what may be an error. In pt.c around
> line 2493, there's this:
>
>> if (TYPE_P (t) )
>> cp_walk_tree (&TYPE_CONTEXT (t), &find_parameter_packs_r, ppd, ppd->visited);
>
> However, gdb shows TYPE_CONTEXT(t) is the constant, 0, during
> compile of src.cpp:

That's not a problem; if the tree passed to walk_tree_1 is null, it just 
returns.

Jason


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-03 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 12:14 In pt.c, find_parameter_packs_r, should TYPE_P(t) assure TYPE_CONTEXT(t)? Larry Evans
2009-08-03 19:39 ` Jason Merrill
2009-08-03 20:08   ` Jason Merrill

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).