gcc/algol68/ChangeLog

        PR algol68/123006
        * a68-imports.cc (complete_encoded_mode): Fix handling of flex
        modes.
---
 gcc/algol68/a68-imports.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/algol68/a68-imports.cc b/gcc/algol68/a68-imports.cc
index c628d21f581..2fbe15d4156 100644
--- a/gcc/algol68/a68-imports.cc
+++ b/gcc/algol68/a68-imports.cc
@@ -706,7 +706,9 @@ complete_encoded_mode (encoded_modes_map_t &encoded_modes, 
uint64_t offset)
       /* For recursive declarations.  */
       em->moid = a68_create_mode (em->kind == GA68_MODE_NAME ? REF_SYMBOL : 
FLEX_SYMBOL,
                                  0, NO_NODE, M_ERROR, NO_PACK);
-      sub = complete_encoded_mode (encoded_modes, em->data.name.sub_offset);
+      sub = complete_encoded_mode (encoded_modes,
+                                  em->kind == GA68_MODE_NAME
+                                  ? em->data.name.sub_offset : 
em->data.flex.sub_offset);
       if (sub == NO_MOID)
        {
          /* Free em->moid */
-- 
2.30.2

Reply via email to