added 'return' to calls to 'luaL_error' (to signal to the compiler

that the function cannot continue past that call)
This commit is contained in:
Roberto Ierusalimschy
2017-03-14 09:40:44 -03:00
parent f5f3df3bd1
commit 1a1b2f3d7f
3 changed files with 11 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstrlib.c,v 1.253 2016/12/20 18:37:00 roberto Exp roberto $
** $Id: lstrlib.c,v 1.254 2016/12/22 13:08:50 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -879,7 +879,7 @@ static int lua_number2strx (lua_State *L, char *buff, int sz,
buff[i] = toupper(uchar(buff[i]));
}
else if (fmt[SIZELENMOD] != 'a')
luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented");
return luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented");
return n;
}
@@ -1199,8 +1199,8 @@ static int getnum (const char **fmt, int df) {
static int getnumlimit (Header *h, const char **fmt, int df) {
int sz = getnum(fmt, df);
if (sz > MAXINTSIZE || sz <= 0)
luaL_error(h->L, "integral size (%d) out of limits [1,%d]",
sz, MAXINTSIZE);
return luaL_error(h->L, "integral size (%d) out of limits [1,%d]",
sz, MAXINTSIZE);
return sz;
}