]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: set version field in CFI_cdesc_t to CFI_VERSION
authorSandra Loosemore <sandra@codesourcery.com>
Thu, 1 Jul 2021 20:07:59 +0000 (13:07 -0700)
committerSandra Loosemore <sandra@codesourcery.com>
Thu, 1 Jul 2021 20:07:59 +0000 (13:07 -0700)
When converting a GFC descriptor to a CFI descriptor, it was
incorrectly copying the version number from the former to the latter.
It should be using the value of CFI_VERSION instead (currently 1).
Going the other direction, the GFC version field is initialized to
zero elsewhere, so do that here too.

2021-06-30  Tobias Burnus  <tobias@codesourcery.com>
    Sandra Loosemore  <sandra@codesourcery.com>

libgfortran/
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc):
Initialize version field to 0.
(gfc_desc_to_cfi_desc): Initialize version field to CFI_VERSION.

libgfortran/runtime/ISO_Fortran_binding.c

index 09788321c9e6520f30f527ab58218a3e0b29214c..73fb4c4e729111077d66ddecf930d36b1861ea31 100644 (file)
@@ -60,7 +60,7 @@ cfi_desc_to_gfc_desc (gfc_array_void *d, CFI_cdesc_t **s_ptr)
   else
     GFC_DESCRIPTOR_SIZE (d) = s->elem_len;
 
-  d->dtype.version = s->version;
+  d->dtype.version = 0;
   GFC_DESCRIPTOR_RANK (d) = (signed char)s->rank;
 
   d->dtype.attribute = (signed short)s->attribute;
@@ -104,7 +104,7 @@ gfc_desc_to_cfi_desc (CFI_cdesc_t **d_ptr, const gfc_array_void *s)
 
   d->base_addr = GFC_DESCRIPTOR_DATA (s);
   d->elem_len = GFC_DESCRIPTOR_SIZE (s);
-  d->version = s->dtype.version;
+  d->version = CFI_VERSION;
   d->rank = (CFI_rank_t)GFC_DESCRIPTOR_RANK (s);
   d->attribute = (CFI_attribute_t)s->dtype.attribute;