This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] gdb: Check for not allocated/associated values during array slicing
- From: Tom Tromey <tom at tromey dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 07 Jun 2019 15:23:56 -0600
- Subject: Re: [PATCH] gdb: Check for not allocated/associated values during array slicing
- References: <firstname.lastname@example.org>
>>>>> "Andrew" == Andrew Burgess <email@example.com> writes:
Andrew> When extracting an array slice we should give up if the array is
Andrew> not-allocated or not-associated. For Fortran, at least in gfortran
Andrew> compiled code, the upper and lower bounds are undefined if the array
Andrew> is not allocated or not associated, in which case performing checks
Andrew> against these bounds will result in undefined behaviour.
Andrew> Better then to throw an error if we try to slice such an array. This
Andrew> changes the error message that the user will receive in these
Andrew> cases (if they got an error message before). Previously they may have
Andrew> gotten "slice out of range" now they'll get "array not allocated" or
Andrew> "array not associated".
I don't know Fortran, so I hesitated to comment on this patch. But,
maybe you are waiting for some feedback? I don't have an objection to
it, though that isn't super comforting considering that I don't know
what an associated type is.