]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
a68: add assert after calling a68_lower_tree on a unit list
authorJose E. Marchesi <jemarch@gnu.org>
Sat, 13 Jun 2026 15:53:33 +0000 (17:53 +0200)
committerJose E. Marchesi <jemarch@gnu.org>
Sat, 13 Jun 2026 16:50:08 +0000 (18:50 +0200)
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-low-clauses.cc (a68_lower_collateral_clause): Check that
a68_lower_tree on the units list return NULL_TREE.

gcc/algol68/a68-low-clauses.cc

index 9fca4b872bc856ec1ef540e54a8811211e760450..fb77f964770affd101e75dcbe5ae46af062613d4 100644 (file)
@@ -1072,7 +1072,12 @@ a68_lower_collateral_clause (NODE_T *p ATTRIBUTE_UNUSED,
   /* Lower the constituent units into a statements list.  */
   a68_push_stmt_list (mode);
   if (!clause_is_empty)
-    (void) a68_lower_tree (NEXT (SUB (p)), ctx);
+    {
+      if (a68_lower_tree (NEXT (SUB (p)), ctx) != NULL_TREE)
+       /* unit lists always lower to NULL_TREE and, as a side-effect,
+          append the units to the current statements list.  */
+       gcc_unreachable ();
+    }
   tree units = a68_pop_stmt_list ();
 
   /* The collateral clause lowers to different constructions depending on its