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.
This commit is contained in:
Jose E. Marchesi
2025-12-27 16:04:06 +01:00
parent 05b35491d3
commit 4ac337019a
2 changed files with 5 additions and 2 deletions

View File

@@ -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. */

View File

@@ -0,0 +1,3 @@
begin []int lele = (1,2,3);
assert (ELEMS (lele) = ELEMS (lele))
end