new facilities to test memory overflow in main.c
This commit is contained in:
11
ltests.c
11
ltests.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltests.c,v 1.145 2002/11/18 15:24:27 roberto Exp roberto $
|
** $Id: ltests.c,v 1.146 2002/11/25 17:47:13 roberto Exp roberto $
|
||||||
** Internal Module for Debugging of the Lua Implementation
|
** Internal Module for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -784,4 +784,13 @@ int luaB_opentests (lua_State *L) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#undef main
|
||||||
|
int main (int argc, char *argv[]) {
|
||||||
|
char *limit = getenv("MEMLIMIT");
|
||||||
|
if (limit)
|
||||||
|
memdebug_memlimit = strtoul(limit, NULL, 10);
|
||||||
|
l_main(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
7
ltests.h
7
ltests.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltests.h,v 1.18 2002/11/12 14:34:18 roberto Exp roberto $
|
** $Id: ltests.h,v 1.19 2002/11/19 17:42:32 roberto Exp roberto $
|
||||||
** Internal Header for Debugging of the Lua Implementation
|
** Internal Header for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -54,6 +54,11 @@ int luaB_opentests (lua_State *L);
|
|||||||
#define LUA_EXTRALIBS { "tests", luaB_opentests },
|
#define LUA_EXTRALIBS { "tests", luaB_opentests },
|
||||||
|
|
||||||
|
|
||||||
|
/* real main will be defined at `ltests.c' */
|
||||||
|
int l_main (int argc, char *argv[]);
|
||||||
|
#define main l_main
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* change some sizes to give some bugs a chance */
|
/* change some sizes to give some bugs a chance */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user