diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.122 2002/05/16 14:59:49 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.123 2002/06/03 20:11:41 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -96,7 +96,10 @@ static void freeblock (void *block) { | |||
96 | 96 | ||
97 | 97 | ||
98 | void *debug_realloc (void *block, size_t oldsize, size_t size) { | 98 | void *debug_realloc (void *block, size_t oldsize, size_t size) { |
99 | lua_assert((oldsize == 0) ? block == NULL : oldsize == *blocksize(block)); | 99 | lua_assert((oldsize == 0) == (block == NULL)); |
100 | lua_assert(oldsize == 0 || oldsize == *blocksize(block)); | ||
101 | /* ISO does not specify what realloc(NULL, 0) does */ | ||
102 | lua_assert(block != NULL || size > 0); | ||
100 | if (size == 0) { | 103 | if (size == 0) { |
101 | freeblock(block); | 104 | freeblock(block); |
102 | return NULL; | 105 | return NULL; |