This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR33727 - Segfault with ugly string array constructor


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]