This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/30659 segfault w/ invalid input
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Seongbae Park <seongbae dot park at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 15 Apr 2007 12:08:02 -0700
- Subject: Re: [PATCH] PR c++/30659 segfault w/ invalid input
- References: <ab3a61990702052225i21d32d57o755e7b3b1a92f720@mail.gmail.com> <m3bqk7the7.fsf@localhost.localdomain> <ab3a61990702060910t47336b8bl48db8c35afc05687@mail.gmail.com>
Seongbae Park wrote:
> On 06 Feb 2007 07:50:08 -0800, Ian Lance Taylor <iant@google.com> wrote:
>> "Seongbae Park" <seongbae.park@gmail.com> writes:
>>
>> > This patch fixes the compiler segmentation fault on an invalid input.
>> > Bootstrapped and regtested on i686-linux.
>> > As I have never looked at c+ frontend before,
>> > there's a high chance I'm not doing the right thing.
>> > OK for mainline ?
>> >
>> > 2007-02-05 Seongbae Park <seongbae.park@gmail.com>
>> >
>> > PR c++/30659
>> > * search.c (lookup_member): Return error_mark_node on NULL
>> basetype.
>>
>> It would be appropriate to add the test case to the testsuite as part
>> of this patch.
>
> The new patch with the testsuite is attached.
>
>> (I can't approve this patch, but looking at it I wonder if should be
>> catching a NULL basetype earlier.)
>
> I wondered about that as well. The NULL xbasetype comes from
> DECL_CONTEXT of a decl, and I couldn't quite figure out
> whether this is allowed or not and I didn't try to trace back
> where it is coming from - and thought it's easier to ask :)
> I'm willing to hunt down deeper if that's the right thing to do.
I think we should look deeper; it seems wrong to ever call lookup_member
with a NULL xbasetype; we should have noticed the problem at some
earlier point. What is the DECL whose DECL_CONTEXT is NULL, and why do
we care? :-)
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713