From 29ba8b1e49b23f8341886d1881246809c6cd668c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 26 Jun 2015 23:51:39 +0300 Subject: Dont check first function parameter if function is pointer to function. Also detect component variable name with field type VAR_DECL. --- src/analysis/expression.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/analysis/expression.cpp b/src/analysis/expression.cpp index 96d84e1..4d4c429 100644 --- a/src/analysis/expression.cpp +++ b/src/analysis/expression.cpp @@ -91,7 +91,7 @@ std::string getComponentRefVariable(Node *node) { IndirectRefNode *indirect = static_cast(object); Node *ref = skipNop(indirect->ref); - if (ref == PARM_DECL) + if (ref == PARM_DECL || ref == VAR_DECL) { str.append(ref->label).append("->").append(field->label); } @@ -482,6 +482,8 @@ void analyseCallExpr(CallExprNode *node, const WalkItem &wi, WalkItem &wo) else { reportParmDeclNullPointer(node, node->function, wi); + if (!getVariableName(node->function).empty()) + enableCheck = false; } } FOR_EACH (std::vector::const_iterator, it, node->args) -- cgit v1.2.3-60-g2f50