Some bugs with stack reallocation by 'luaF_close'
(Long time without testing with '-DHARDSTACKTESTS'...) With the introduction of to-be-closed variables, calls to 'luaF_close' can move the stack, but some call sites where keeping pointers to the stack without correcting them.
This commit is contained in:
2
ltests.c
2
ltests.c
@@ -142,7 +142,7 @@ void *debug_realloc (void *ud, void *b, size_t oldsize, size_t size) {
|
||||
freeblock(mc, block);
|
||||
return NULL;
|
||||
}
|
||||
if (mc->countlimit != ~0UL && size > 0) { /* count limit in use? */
|
||||
if (mc->countlimit != ~0UL && size != oldsize) { /* count limit in use? */
|
||||
if (mc->countlimit == 0)
|
||||
return NULL; /* fake a memory allocation error */
|
||||
mc->countlimit--;
|
||||
|
||||
Reference in New Issue
Block a user