aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-09-30 09:44:45 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-09-30 09:44:45 -0300
commite24f1ee9ff2def53a5cca19038d8b1ee6afc5c62 (patch)
treeccf04acdd8c822be215c401d8167d7478724cf13
parentf3b0eb3ecfc749767cdb37ef9651d2a76daa0983 (diff)
downloadlua-e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62.tar.gz
lua-e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62.tar.bz2
lua-e24f1ee9ff2def53a5cca19038d8b1ee6afc5c62.zip
lint (unreachable code)
-rw-r--r--lapi.c18
-rw-r--r--lparser.c4
2 files changed, 11 insertions, 11 deletions
diff --git a/lapi.c b/lapi.c
index c26935c0..61a80085 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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
307LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { 307LUA_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;
diff --git a/lparser.c b/lparser.c
index 7841c937..26b397ca 100644
--- a/lparser.c
+++ b/lparser.c
@@ -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