Formatting
This commit is contained in:
parent
382408f59e
commit
965fea370f
|
@ -5957,7 +5957,8 @@ static void valueFlowSmartPointer(TokenList *tokenlist, ErrorLogger * errorLogge
|
|||
if (!var->isSmartPointer())
|
||||
continue;
|
||||
if (var->nameToken() == tok) {
|
||||
if (Token::Match(tok, "%var% (|{") && tok->next()->astOperand2() && tok->next()->astOperand2()->str() != ",") {
|
||||
if (Token::Match(tok, "%var% (|{") && tok->next()->astOperand2() &&
|
||||
tok->next()->astOperand2()->str() != ",") {
|
||||
Token* inTok = tok->next()->astOperand2();
|
||||
std::list<ValueFlow::Value> values = inTok->values();
|
||||
const bool constValue = inTok->isNumber();
|
||||
|
@ -5993,7 +5994,8 @@ static void valueFlowSmartPointer(TokenList *tokenlist, ErrorLogger * errorLogge
|
|||
values.push_back(v);
|
||||
valueFlowForwardAssign(tok->tokAt(4), var, values, false, false, tokenlist, errorLogger, settings);
|
||||
}
|
||||
} else if (Token::Match(tok->previous(), "%name%|> (|{") && astIsSmartPointer(tok) && astIsSmartPointer(tok->astOperand1())) {
|
||||
} else if (Token::Match(tok->previous(), "%name%|> (|{") && astIsSmartPointer(tok) &&
|
||||
astIsSmartPointer(tok->astOperand1())) {
|
||||
std::vector<const Token*> args = getArguments(tok);
|
||||
if (args.empty())
|
||||
continue;
|
||||
|
|
|
@ -2866,7 +2866,8 @@ private:
|
|||
"}\n"
|
||||
"void g() {\n"
|
||||
" int a = *f();\n"
|
||||
"}\n", true);
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("[test.cpp:5]: (error) Null pointer dereference: f()\n", errout.str());
|
||||
}
|
||||
|
||||
|
|
|
@ -1153,8 +1153,8 @@ private:
|
|||
ASSERT_EQUALS(expected, tok(code, false));
|
||||
ASSERT_EQUALS_WITHOUT_LINENUMBERS(
|
||||
"[test.cpp:31]: (debug) valueflow.cpp:3109:valueFlowFunctionReturn bailout: function return; nontrivial function body\n"
|
||||
"[test.cpp:28]: (debug) valueflow.cpp:3109:valueFlowFunctionReturn bailout: function return; nontrivial function body\n"
|
||||
, errout.str());
|
||||
"[test.cpp:28]: (debug) valueflow.cpp:3109:valueFlowFunctionReturn bailout: function return; nontrivial function body\n",
|
||||
errout.str());
|
||||
}
|
||||
|
||||
void simplifyTypedef36() {
|
||||
|
|
Loading…
Reference in New Issue