From 5897bd77709df9a4e09f35c0d26cc680e11fec9c Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Mon, 6 Mar 2017 14:09:27 +0500 Subject: [PATCH] cppcheck complains that "fs" being derefenced many times before "if(fs)" check I think we should remove "if(fs)" condition here. [src/host/minilua.c:3902] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3905] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3906] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3907] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3908] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3909] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3910] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3911] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3912] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3913] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3914] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. [src/host/minilua.c:3917] -> [src/host/minilua.c:3918]: (warning) Either the condition 'if(fs)' is redundant or there is possible null pointer dereference: fs. --- src/host/minilua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host/minilua.c b/src/host/minilua.c index 79150286..418f608a 100644 --- a/src/host/minilua.c +++ b/src/host/minilua.c @@ -3915,7 +3915,7 @@ f->sizelocvars=fs->nlocvars; luaM_reallocvector(L,f->upvalues,f->sizeupvalues,f->nups,TString*); f->sizeupvalues=f->nups; ls->fs=fs->prev; -if(fs)anchor_token(ls); +anchor_token(ls); L->top-=2; } static Proto*luaY_parser(lua_State*L,ZIO*z,Mbuffer*buff,const char*name){