Patchwork [fortran,4.6,Regression] ICE: Segmentation fault in gfc_conv_procedure_call

login
register
mail settings
Submitter Jerry DeLisle
Date Nov. 12, 2010, 10:53 p.m.
Message ID <4CDDC563.1050203@frontier.com>
Download mbox | patch
Permalink /patch/71028/
State New
Headers show

Comments

Jerry DeLisle - Nov. 12, 2010, 10:53 p.m.
Hi folks,

This patch is obvious and simple.  I will commit to trunk shortly with ChangeLog 
and test case.

Segfault occurs because fsym->as was NULL. Regression tests OK on x86-64-linux-gnu.

Regards,

Jerry

Patch

Index: trans-expr.c
===================================================================
--- trans-expr.c	(revision 166672)
+++ trans-expr.c	(working copy)
@@ -3121,8 +3121,10 @@  gfc_conv_procedure_call (gfc_se * se, gfc_symbol *
  	      && ((e->rank > 0 && sym->attr.elemental)
  		  || e->representation.length || e->ts.type == BT_CHARACTER
  		  || (e->rank > 0
-		      && (fsym == NULL || fsym->as->type == AS_ASSUMED_SHAPE
-			  || fsym->as->type == AS_DEFERRED))))
+		      && (fsym == NULL
+			  || (fsym-> as
+			      && (fsym->as->type == AS_ASSUMED_SHAPE
+			      	  || fsym->as->type == AS_DEFERRED))))))
  	    gfc_conv_missing_dummy (&parmse, e, fsym ? fsym->ts : e->ts,
  				    e->representation.length);
  	}