[patch, fortran] PR31251 Non-integer character length leads to segfault
Jerry DeLisle
jvdelisle@verizon.net
Sat May 5 17:41:00 GMT 2007
:ADDPATCH fortran:
This is the second half of the fix for this bug. The first half fixed the
segfault problem. This patch fixes the double error message.
It turns out that since the character specification was being matched for both a
function prefix and a variable declaration, a character length was being added
to the cl_list for both times. The error in the character length was then
getting issued when cl_list is resolved, giving two error messages.
To fix this, I placed a check in decl.c (match_char_spec) to issue the error and
exit before the bogus lengths are added to cl_list.
Bootstrapped on latest trunk and passes regression testing on x86-64-gnu-linux.
I will make a test case as appropriate.
OK for trunk?
Jerry
2007-05-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31251
* decl.c (match_char_spec): Add check for invalid character lengths.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr31251-b.diff
Type: text/x-patch
Size: 529 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070505/bb0e25c3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr31251.f90
Type: text/x-fortran
Size: 49 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070505/bb0e25c3/attachment-0001.bin>
More information about the Fortran
mailing list