+2001-10-30 Richard Kenner <kenner@gnat.com>
+
+ * utils2.c (build_allocator): Test for SIZE overflow in array case too
+
2001-10-30 Geert Bosch <bosch@gnat.com>
* ali-util.adb (Initialize_Checksum): Use out-mode instead of in out.
&& contains_placeholder_p (size))
size = build (WITH_RECORD_EXPR, sizetype, size, init);
+ /* If the size overflows, pass -1 so the allocator will raise
+ storage error. */
+ if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size))
+ size = ssize_int (-1);
+
storage = build_call_alloc_dealloc (NULL_TREE, size,
TYPE_ALIGN (storage_type),
gnat_proc, gnat_pool);