extra api checks for number of returns of C functions and for lua_yield

This commit is contained in:
Roberto Ierusalimschy
2009-11-27 13:37:59 -02:00
parent 3acf5ec5a1
commit 3e41afcec5
3 changed files with 10 additions and 6 deletions

5
lapi.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.h,v 2.5 2009/04/03 15:58:03 roberto Exp roberto $
** $Id: lapi.h,v 2.6 2009/08/31 14:26:28 roberto Exp roberto $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
@@ -17,5 +17,8 @@
#define adjustresults(L,nres) \
{ if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
"not enough elements in the stack")
#endif