[gcc r16-6411] a68: avoid pack_soids_in_moid to return unregistered modes
Jose E. Marchesi
jemarch@gcc.gnu.org
Sat Dec 27 15:07:05 GMT 2025
https://gcc.gnu.org/g:4ac337019ab71bb247fd56ef56d81f1dc0690151
commit r16-6411-g4ac337019ab71bb247fd56ef56d81f1dc0690151
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date: Sat Dec 27 16:04:06 2025 +0100
a68: avoid pack_soids_in_moid to return unregistered modes
This function fixes the pack_soids_in_moid function so it never
returns a mode that has not been registered.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
* a68-moids-misc.cc (a68_pack_soids_in_moid): Return the result of
a68_register_extra_mode.
gcc/testsuite/ChangeLog
* algol68/execute/pack-soids-in-moid-1.a68: New test.
Diff:
---
gcc/algol68/a68-moids-misc.cc | 4 ++--
gcc/testsuite/algol68/execute/pack-soids-in-moid-1.a68 | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gcc/algol68/a68-moids-misc.cc b/gcc/algol68/a68-moids-misc.cc
index 349c13fd6565..cafb04a16ad6 100644
--- a/gcc/algol68/a68-moids-misc.cc
+++ b/gcc/algol68/a68-moids-misc.cc
@@ -280,8 +280,8 @@ a68_pack_soids_in_moid (SOID_T *top_sl, int attribute)
*p = t;
p = &NEXT (t);
}
- (void) a68_register_extra_mode (&TOP_MOID (&A68_JOB), x);
- return x;
+
+ return a68_register_extra_mode (&TOP_MOID (&A68_JOB), x);
}
/* Whether P is compatible with Q. */
diff --git a/gcc/testsuite/algol68/execute/pack-soids-in-moid-1.a68 b/gcc/testsuite/algol68/execute/pack-soids-in-moid-1.a68
new file mode 100644
index 000000000000..b5857088ef10
--- /dev/null
+++ b/gcc/testsuite/algol68/execute/pack-soids-in-moid-1.a68
@@ -0,0 +1,3 @@
+begin []int lele = (1,2,3);
+ assert (ELEMS (lele) = ELEMS (lele))
+end
More information about the Gcc-cvs
mailing list