PR33727 - Segfault with ugly string array constructor

Paul Richard Thomas paul.richard.thomas@gmail.com
Thu Oct 11 07:25:00 GMT 2007


Tobi,

The cause of this PR is a typo in trans-array.c(get_array_ctor_var_strlen).

Index: gcc/fortran/trans-array.c
===================================================================
*** gcc/fortran/trans-array.c   (révision 129121)
--- gcc/fortran/trans-array.c   (copie de travail)
*************** get_array_ctor_var_strlen (gfc_expr * ex
*** 1340,1346 ****

        case REF_SUBSTRING:
          if (ref->u.ss.start->expr_type != EXPR_CONSTANT
!               || ref->u.ss.start->expr_type != EXPR_CONSTANT)
            break;
          mpz_init_set_ui (char_len, 1);
          mpz_add (char_len, char_len, ref->u.ss.end->value.integer);
--- 1340,1346 ----

        case REF_SUBSTRING:
          if (ref->u.ss.start->expr_type != EXPR_CONSTANT
!               || ref->u.ss.end->expr_type != EXPR_CONSTANT)
            break;
          mpz_init_set_ui (char_len, 1);
          mpz_add (char_len, char_len, ref->u.ss.end->value.integer);

I'm struggling to find the time to get some other patches out of the
door.  If you want to fix this one, please go ahead and do so.

Cheers

Paul

-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy



More information about the Fortran mailing list