This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix crash in expression evaluation
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 30 Oct 2008 14:07:32 -0600
- Subject: Re: RFA: fix crash in expression evaluation
- References: <m3od22hpue.fsf@fleche.redhat.com> <20081030035443.GB13387@adacore.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Tom> + struct type *type;
Joel> Nit-picking. I think that the general convention here is to separate
Joel> local declarations from the rest of the block with an empty line.
Ok, fixed.
Joel> I don't think the second line is useful, is it? type should
Joel> necessarily be a TYPE_CODE_PTR, if I understand
Joel> value_coerce_array correctly. So it goes from being a
Joel> TYPE_CODE_ARRAY to a TYPE_CODE_PTR. In neither case will it
Joel> cause the check just below to be true.
Yeah, good point.
Joel> Honestly, I think that the code is poorly written. How about using
Joel> a case statement or at least a if/else if sequence. Would something
Joel> like this work?
Looks good to me.
I'll send it through the tester.
Tom