aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-25 19:55:41 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-25 19:55:41 -0200
commita048cc9676f3572ebf5d6cc061f87cba85f5a249 (patch)
treea7a1fe7ebf6b0f1dab20eaf58176e46647e0ebc6 /lapi.c
parenteb262bc61754670d45fb030432932c599cdef2d6 (diff)
downloadlua-a048cc9676f3572ebf5d6cc061f87cba85f5a249.tar.gz
lua-a048cc9676f3572ebf5d6cc061f87cba85f5a249.tar.bz2
lua-a048cc9676f3572ebf5d6cc061f87cba85f5a249.zip
nil is a `valid' eventtable
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index 65781254..94511e3d 100644
--- a/lapi.c
+++ b/lapi.c
@@ -35,7 +35,7 @@ const char lua_ident[] =
35 35
36#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->ci->base)) 36#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->ci->base))
37 37
38#define api_incr_top(L) incr_top 38#define api_incr_top(L) incr_top(L)
39 39
40 40
41 41
@@ -81,7 +81,7 @@ static TObject *luaA_indexAcceptable (lua_State *L, int index) {
81 81
82void luaA_pushobject (lua_State *L, const TObject *o) { 82void luaA_pushobject (lua_State *L, const TObject *o) {
83 setobj(L->top, o); 83 setobj(L->top, o);
84 incr_top; 84 incr_top(L);
85} 85}
86 86
87LUA_API int lua_stackspace (lua_State *L) { 87LUA_API int lua_stackspace (lua_State *L) {
@@ -335,7 +335,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
335 while (n--) 335 while (n--)
336 setobj(&cl->c.upvalue[n], L->top+n); 336 setobj(&cl->c.upvalue[n], L->top+n);
337 setclvalue(L->top, cl); 337 setclvalue(L->top, cl);
338 incr_top; 338 api_incr_top(L);
339 lua_unlock(L); 339 lua_unlock(L);
340} 340}
341 341
@@ -494,6 +494,8 @@ LUA_API void lua_seteventtable (lua_State *L, int objindex) {
494 api_checknelems(L, 1); 494 api_checknelems(L, 1);
495 obj = luaA_indexAcceptable(L, objindex); 495 obj = luaA_indexAcceptable(L, objindex);
496 et = --L->top; 496 et = --L->top;
497 if (ttype(et) == LUA_TNIL)
498 et = defaultet(L);
497 api_check(L, ttype(et) == LUA_TTABLE); 499 api_check(L, ttype(et) == LUA_TTABLE);
498 switch (ttype(obj)) { 500 switch (ttype(obj)) {
499 case LUA_TTABLE: 501 case LUA_TTABLE: