[patch, fortran] PR18923 segfault after subroutine name confusion

Jerry DeLisle jvdelisle@verizon.net
Sat Jun 2 21:07:00 GMT 2007


:ADDPATCH fortran:

This patch completes the fix for this PR.  The scrambled symbols were coming
from improperly allocating namespace pointers after an error with a CONTAINS block.

The key is to do the right thing when rejecting a statement.  The tmp namespace
pointer is needed to make sure we tie up the loose ends correctly. The test for 
tmp->refs is to avoid an assert later for keyword_symbol_1.f90 in the testsuite.

This patch partially fixes pr25252 which suffers the CONTAINS problem fixed here
as well as something else.  I am on that trail now.

Regression tested on x86-64-gnu-linux.  I will add the two cases from the PR now 
that the errors have been stabilized.

OK for trunk?

Regards,

Jerry

2007-06-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/18923
	* parse.c (decode_statement): Don't call gfc_undo_symbols on MATCH_ERROR
	for ST_FUNCTION since it is called in reject_statement.
	(parse_contained): If error, loop back after reject_statement and try
	again.  Free the namespace if an error occured.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr18923c.diff
Type: text/x-patch
Size: 2532 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070602/ab8335dd/attachment.bin>


More information about the Gcc-patches mailing list