[gfortran,patch] Fix PR27588: Add substring-out-of-bounds check

Tobias Burnus burnus@net-b.de
Fri Nov 10 23:48:00 GMT 2006


:ADDPATCH fortran:

The attached patch adds a "substring out of bounds" check, in the spirit
of trans-array.c's gfc_trans_array_bound_check.

This is an improved version; the first
(http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00234.html) didn't
displayed the right line number and no variable name; the second by FX
(http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01030.html) added the
variable name  - and this version fixes the line-number display.

I used CBND1, CBND2 and CBND4 of
http://www.polyhedron.com/pb05/linux/diagnose.html, which all are
detected (with variable name), which increases our diagnostics
statistics from 34% -> 39% ;-)

FX wrote (regarding his patch): "I've been working to find how to output
the variable name, [...] but it still doesn't work in all cases."
If you find an example where it does not work, I'm happy to look at it.
(I didn't find one, but I didn't look for it extensively)

Compiled and regtested on x86_64-unknown-linux-gnu-gcc.
Ok for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bounds2.diff
Type: text/x-patch
Size: 3832 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061110/9ca43d7e/attachment.bin>


More information about the Gcc-patches mailing list