This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: fix crash in expression evaluation


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]