diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-09-30 09:44:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-09-30 09:44:45 -0300 |
commit | e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62 (patch) | |
tree | ccf04acdd8c822be215c401d8167d7478724cf13 | |
parent | f3b0eb3ecfc749767cdb37ef9651d2a76daa0983 (diff) | |
download | lua-e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62.tar.gz lua-e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62.tar.bz2 lua-e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62.zip |
lint (unreachable code)
-rw-r--r-- | lapi.c | 18 | ||||
-rw-r--r-- | lparser.c | 4 |
2 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.151 2011/08/17 20:26:47 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.152 2011/09/26 20:17:27 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -306,17 +306,17 @@ LUA_API void lua_arith (lua_State *L, int op) { | |||
306 | 306 | ||
307 | LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { | 307 | LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { |
308 | StkId o1, o2; | 308 | StkId o1, o2; |
309 | int i; | 309 | int i = 0; |
310 | lua_lock(L); /* may call tag method */ | 310 | lua_lock(L); /* may call tag method */ |
311 | o1 = index2addr(L, index1); | 311 | o1 = index2addr(L, index1); |
312 | o2 = index2addr(L, index2); | 312 | o2 = index2addr(L, index2); |
313 | if (!isvalid(o1) || !isvalid(o2)) | 313 | if (isvalid(o1) && isvalid(o2)) { |
314 | i = 0; | 314 | switch (op) { |
315 | else switch (op) { | 315 | case LUA_OPEQ: i = equalobj(L, o1, o2); break; |
316 | case LUA_OPEQ: i = equalobj(L, o1, o2); break; | 316 | case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break; |
317 | case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break; | 317 | case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break; |
318 | case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break; | 318 | default: api_check(L, 0, "invalid option"); |
319 | default: api_check(L, 0, "invalid option"); i = 0; | 319 | } |
320 | } | 320 | } |
321 | lua_unlock(L); | 321 | lua_unlock(L); |
322 | return i; | 322 | return i; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.118 2011/08/30 16:38:58 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.119 2011/09/14 17:40:26 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1611,8 +1611,8 @@ Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, | |||
1611 | close_func(&lexstate); | 1611 | close_func(&lexstate); |
1612 | L->top--; /* pop name */ | 1612 | L->top--; /* pop name */ |
1613 | lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); | 1613 | lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); |
1614 | return funcstate.f; | ||
1615 | /* all scopes should be correctly finished */ | 1614 | /* all scopes should be correctly finished */ |
1616 | lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); | 1615 | lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); |
1616 | return funcstate.f; | ||
1617 | } | 1617 | } |
1618 | 1618 | ||