This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv2] compile: Fix crash on cv-qualified self-reference
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org, Phil Muldoon <pmuldoon at redhat dot com>
- Date: Wed, 01 Jul 2015 15:06:06 +0100
- Subject: Re: [patchv2] compile: Fix crash on cv-qualified self-reference
- Authentication-results: sourceware.org; auth=none
- References: <20150418172843 dot GA17777 at host1 dot jankratochvil dot net> <20150516132555 dot GB17266 at host1 dot jankratochvil dot net> <86lhf0p1hf dot fsf at gmail dot com> <20150701132406 dot GA13975 at host1 dot jankratochvil dot net>
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> I can change it that way but when you ask "isn't cleaner" then no, I think
> your hack is even a bit more ugly than my ugly hack.
>
OK, that is sort of personal preference, that is fine to me to leave it
as is.
> There should be two virtual methods, one pure for 'switch (TYPE_CODE (type))'
> and the other one checking TYPE_INSTANCE_FLAG* in superclass overriden only by
> TYPE_CODE_STRUCT and TYPE_CODE_UNION (there would be no TYPE_CODE_*, though).
If we change to virtual methods, we don't need "switch" at all. Each type
can have its virtual method to handle this separately.
--
Yao (éå)