UnusedVar: Fix FP for array arguments
This commit is contained in:
parent
1f27cd56c0
commit
092d434f91
|
@ -1181,6 +1181,9 @@ bool FwdAnalysis::isGlobalData(const Token *expr) const
|
|||
if (lhsvar->isPointer()) {
|
||||
globalData = true;
|
||||
return ChildrenToVisit::none;
|
||||
} else if (lhsvar->isArgument() && lhsvar->isArray()) {
|
||||
globalData = true;
|
||||
return ChildrenToVisit::none;
|
||||
} else if (lhsvar->isArgument() && (!lhstype || (lhstype->type <= ValueType::Type::VOID && !lhstype->container))) {
|
||||
globalData = true;
|
||||
return ChildrenToVisit::none;
|
||||
|
|
|
@ -4287,6 +4287,13 @@ private:
|
|||
"}\n"
|
||||
);
|
||||
// TODO This works on command line.. load std.cfg? ASSERT_EQUALS("error", errout.str());
|
||||
|
||||
functionVariableUsage(
|
||||
"void fun(short data[2]) {\n"
|
||||
" data[2] = 1;\n"
|
||||
"}"
|
||||
);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue