diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-29 17:43:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-29 17:43:28 -0300 |
commit | a97f29f15487c5f584185f646f9cfc06a04b26ca (patch) | |
tree | e7ffd959fb80f9622d74a2efadfd7880037d64ca /lauxlib.c | |
parent | 4135f4f5862b57d9dbf3e9b7c6507f5c86516327 (diff) | |
download | lua-a97f29f15487c5f584185f646f9cfc06a04b26ca.tar.gz lua-a97f29f15487c5f584185f646f9cfc06a04b26ca.tar.bz2 lua-a97f29f15487c5f584185f646f9cfc06a04b26ca.zip |
explicit stack control in the API
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.31 2000/08/28 17:57:04 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.32 2000/08/29 14:33:31 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -49,6 +49,12 @@ static void type_error (lua_State *L, int narg, const char *type_name) { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | 51 | ||
52 | void luaL_checkstack (lua_State *L, int space, const char *mes) { | ||
53 | if (space > lua_stackspace(L)) | ||
54 | luaL_verror(L, "stack overflow (%.30s)", mes); | ||
55 | } | ||
56 | |||
57 | |||
52 | /* | 58 | /* |
53 | ** use the 3rd letter of type names for testing: | 59 | ** use the 3rd letter of type names for testing: |
54 | ** nuMber, niL, stRing, fuNction, usErdata, taBle, anY | 60 | ** nuMber, niL, stRing, fuNction, usErdata, taBle, anY |