Skip to content

Commit

Permalink
cppcheck: (error) Address of local auto-variable assigned
Browse files Browse the repository at this point in the history
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
  • Loading branch information
behlendorf committed Dec 19, 2019
1 parent 1e49b28 commit 487bdda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions module/lua/ldebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions module/lua/ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,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);
Expand Down

0 comments on commit 487bdda

Please sign in to comment.