[fortran,patch] Fix PR 25252, error-recovery and ice-on-invalid

FX Coudert fxcoudert@gmail.com
Sat Nov 17 16:41:00 GMT 2007


Attached patch fixes PR 25252, which is in fact two error-recovery  
and ice-on-invalid bugs in gfc_match_modproc(), the function that  
matches module procedure statements. The first part is to move the  
check for syntax error earlier in the loop. The second part is the  
recovery part: when we have a syntax error after having succesfully  
emitted code for some symbols (like "module procedure foo, bar, not  
=> allowed"), we used to no remove the already created symbols (foo  
and bar) from the interface, even though the symbols will be cleaned  
up in reject_statement(). Thus, the interface's sym- 
 >interface.generic (if it's a generic interface, e.g.) was left with  
pointers to cleaned up memory. I counter this by resetting the  
interface to its previous state (creating two auxiliary functions in  
interface.c to help), and freeing the allocated gfc_interface's.

Bootstrapped and regtested on x86_64-linux, OK to commit?

FX



:ADDPATCH fortran:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr25252.ChangeLog
Type: application/octet-stream
Size: 519 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071117/08c21040/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr25252.diff
Type: application/octet-stream
Size: 4519 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071117/08c21040/attachment-0001.obj>


More information about the Fortran mailing list