aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/memory.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-10-04 21:27:29 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-10-04 21:27:29 +0200
commit58c5b409e89f4250bddf1ba114b3058d4dfab718 (patch)
treef997c7996452c6a047a1c132b79457094d5ea30b /libgfortran/runtime/memory.c
parent110aba1432fa485c5c0ca2ad499822b7bfafd208 (diff)
downloadgcc-58c5b409e89f4250bddf1ba114b3058d4dfab718.zip
gcc-58c5b409e89f4250bddf1ba114b3058d4dfab718.tar.gz
gcc-58c5b409e89f4250bddf1ba114b3058d4dfab718.tar.bz2
re PR fortran/17283 (UNPACK issues)
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. From-SVN: r88526
Diffstat (limited to 'libgfortran/runtime/memory.c')
-rw-r--r--libgfortran/runtime/memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c
index ca5eb15..5b14600 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);
}