+2007-05-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/32124
+ * runtime/memory.c (allocate_size): Use ERROR_ALLOCATION.
+ (allocate,allocate64): Use stat variable if present.
+
2007-05-27 Janne Blomqvist <jb@gcc.gnu.org>
* runtime/string.c (compare0): Use gfc_charlen_type instead of
{
if (stat)
{
- *stat = 1;
+ *stat = ERROR_ALLOCATION;
return newmem;
}
else
allocate (GFC_INTEGER_4 size, GFC_INTEGER_4 * stat)
{
if (size < 0)
- runtime_error ("Attempt to allocate negative amount of memory. "
- "Possible integer overflow");
+ {
+ if (stat)
+ {
+ *stat = ERROR_ALLOCATION;
+ return NULL;
+ }
+ else
+ runtime_error ("Attempt to allocate negative amount of memory. "
+ "Possible integer overflow");
+ }
return allocate_size ((size_t) size, stat);
}
allocate64 (GFC_INTEGER_8 size, GFC_INTEGER_4 * stat)
{
if (size < 0)
- runtime_error ("ALLOCATE64: Attempt to allocate negative amount of "
- "memory. Possible integer overflow");
+ {
+ if (stat)
+ {
+ *stat = ERROR_ALLOCATION;
+ return NULL;
+ }
+ else
+ runtime_error ("ALLOCATE64: Attempt to allocate negative amount of "
+ "memory. Possible integer overflow");
+ }
return allocate_size ((size_t) size, stat);
}