cppcheck: (error) Address of local auto-variable assigned

Suppress autoVariables warnings in the lua interpreter.  The usage
here while unconventional in intentional and the same as upstream.

[module/lua/ldebug.c:327]: (error) Address of local auto-variable
    assigned to a function parameter.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9732
This commit is contained in:
Brian Behlendorf 2019-12-16 15:53:43 -08:00 committed by Tony Hutter
parent 1c27877ab2
commit 180c41e0b7
2 changed files with 2 additions and 0 deletions

View File

@ -324,6 +324,7 @@ static void kname (Proto *p, int pc, int c, const char **name) {
if (ISK(c)) { /* is 'c' a constant? */
TValue *kvalue = &p->k[INDEXK(c)];
if (ttisstring(kvalue)) { /* literal constant? */
// cppcheck-suppress autoVariables
*name = svalue(kvalue); /* it is its own name */
return;
}

View File

@ -168,6 +168,7 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
struct lua_longjmp lj;
lj.status = LUA_OK;
lj.previous = L->errorJmp; /* chain new error handler */
// cppcheck-suppress autoVariables
L->errorJmp = &lj;
LUAI_TRY(L, &lj,
(*f)(L, ud);