From a965f64afc2f9cd327c7bfb61c3d6dda8b7acd20 Mon Sep 17 00:00:00 2001 From: tobi Date: Mon, 4 Oct 2004 19:27:29 +0000 Subject: PR fortran/17283 fortran/ * iresolve.c (gfc_resolve_pack): Choose function depending if mask is scalar. libgfortran/ * intrinsics/pack_generic.c (__pack): Allocate memory for return array if not done by caller. (__pack_s): New function. * runtime/memory.c (internal_malloc, internal_malloc64): Allow allocating zero memory. testsuite/ * gfortran.fortran-torture/execute/intrinsic_pack.f90: Add more tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88526 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/runtime/memory.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libgfortran/runtime') diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c index ca5eb15244b..5b146000b8d 100644 --- a/libgfortran/runtime/memory.c +++ b/libgfortran/runtime/memory.c @@ -165,8 +165,8 @@ internal_malloc (GFC_INTEGER_4 size) { #ifdef GFC_CHECK_MEMORY /* Under normal circumstances, this is _never_ going to happen! */ - if (size <= 0) - runtime_error ("Attempt to allocate a non-positive amount of memory."); + if (size < 0) + runtime_error ("Attempt to allocate a negative amount of memory."); #endif return internal_malloc_size ((size_t) size); @@ -178,8 +178,8 @@ internal_malloc64 (GFC_INTEGER_8 size) { #ifdef GFC_CHECK_MEMORY /* Under normal circumstances, this is _never_ going to happen! */ - if (size <= 0) - runtime_error ("Attempt to allocate a non-positive amount of memory."); + if (size < 0) + runtime_error ("Attempt to allocate a negative amount of memory."); #endif return internal_malloc_size ((size_t) size); } -- cgit v1.2.1