From ed875a8dfb0d4dc977fb78fc25111d93bea174f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Aug 2015 19:55:54 +0300 Subject: Fix false positives in references. Before it counted as pointers. --- src/analysis/expression.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/analysis/expression.cpp b/src/analysis/expression.cpp index b7af406..70e25a3 100644 --- a/src/analysis/expression.cpp +++ b/src/analysis/expression.cpp @@ -289,6 +289,15 @@ std::vector getComponentRefLeftParts(Node *node) Node *ref = skipNop(indirect->ref); if (ref && !isValidVar(ref->label)) return str; + if (ref == PARM_DECL) + { + ParmDeclNode *parmDecl = static_cast(ref); + if (skipNop(parmDecl->declType) != nullptr && + skipNop(parmDecl->declType) != POINTER_TYPE) + { + return str; + } + } if (ref == VAR_DECL) { VarDeclNode *varDecl = static_cast(ref); @@ -298,6 +307,8 @@ std::vector getComponentRefLeftParts(Node *node) { isNonNull = true; } + if (varDecl->varType != POINTER_TYPE) + return str; } if (ref == PARM_DECL || ref == VAR_DECL) { -- cgit v1.2.3-60-g2f50