This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Invalid tree node causes segfault in diagnostic
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Paulo Matos <pmatos at broadcom dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 11 Oct 2013 19:08:58 +0200
- Subject: RE: Invalid tree node causes segfault in diagnostic
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F462DA932 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <CAFiYyc3kCSzGq9yUidnyBJyGKfAkBLOA_3Wcnv+HQo3t5ipDkQ at mail dot gmail dot com> <19EB96622A777C4AB91610E763265F462DAEF2 at SJEXCHMB14 dot corp dot ad dot broadcom dot com>
Paulo Matos <pmatos@broadcom.com> wrote:
>> -----Original Message-----
>> From: Richard Biener [mailto:richard.guenther@gmail.com]
>> Sent: 11 October 2013 13:47
>> To: Paulo Matos
>> Cc: gcc@gcc.gnu.org
>> Subject: Re: Invalid tree node causes segfault in diagnostic
>>
>>
>> Hmm. We have several places accessing tree_code_name without
>checking.
>> May I suggest to abstract accesses to it with a function call which
>can
>> do the proper checking and return "<invalid tree code>" instead?
>>
>
>Sounds good. I will prepare a patch with the change suggested for
>review.
>While I am at it, can I patch backends as well? For example mep/mep.c
>has an occurrence
>of tree_code_name[TREE_CODE (...
Sure. Tree_code_name should be static inside tree.c after the patch.
Thanks,
Richard.