[Bug fortran/35724] [4.3/4.4 Regression] Compile time segmentation fault for CSHIFT with negative third arg

jvdelisle at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 28 04:18:00 GMT 2008



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2008-03-28 04:18 -------
The following patch appears to fix this.

Index: iresolve.c
===================================================================
--- iresolve.c  (revision 133275)
+++ iresolve.c  (working copy)
@@ -597,7 +597,8 @@ gfc_resolve_cshift (gfc_expr *f, gfc_exp

   if (dim != NULL)
     {
-      if (dim->expr_type != EXPR_CONSTANT &&
dim->symtree->n.sym->attr.optional)
+      if (dim->expr_type != EXPR_CONSTANT && dim->symtree != NULL
+         && dim->symtree->n.sym->attr.optional)
        {
          /* Mark this for later setting the type in gfc_conv_missing_dummy. 
*/
          dim->representation.length = shift->ts.kind;

Another of my doing.  I will commit after regression testing.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.3.1 4.4.0
      Known to work|                            |4.1.2 4.2.4
            Summary|Compile time segmentation   |[4.3/4.4 Regression] Compile
                   |fault for CSHIFT with       |time segmentation fault for
                   |negative third arg          |CSHIFT with negative third
                   |                            |arg


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35724



More information about the Gcc-bugs mailing list