ValueFlow: Fix crash
This commit is contained in:
parent
9c50136571
commit
915ae4b845
|
@ -5107,6 +5107,8 @@ static void valueFlowForwardAssign(Token* const tok,
|
|||
|
||||
// Skip RHS
|
||||
const Token * nextExpression = tok->astParent() ? nextAfterAstRightmostLeaf(tok->astParent()) : tok->next();
|
||||
if (!nextExpression)
|
||||
return;
|
||||
|
||||
for (ValueFlow::Value& value : values) {
|
||||
if (value.isSymbolicValue())
|
||||
|
|
|
@ -6397,6 +6397,13 @@ private:
|
|||
" s;\n"
|
||||
"}\n";
|
||||
valueOfTok(code, "s");
|
||||
|
||||
code = "int f(int value) { return 0; }\n"
|
||||
"std::shared_ptr<Manager> g() {\n"
|
||||
" static const std::shared_ptr<Manager> x{ new M{} };\n"
|
||||
" return x;\n"
|
||||
"}\n";
|
||||
valueOfTok(code, "x");
|
||||
}
|
||||
|
||||
void valueFlowHang() {
|
||||
|
|
Loading…
Reference in New Issue