Fix 10957: Crash on valid code (#3991)
This commit is contained in:
parent
bd9f5231b8
commit
45b4580554
|
@ -5736,6 +5736,9 @@ struct ConditionHandler {
|
||||||
std::swap(thenValues, elseValues);
|
std::swap(thenValues, elseValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!condTop)
|
||||||
|
return;
|
||||||
|
|
||||||
if (Token::simpleMatch(condTop, "?")) {
|
if (Token::simpleMatch(condTop, "?")) {
|
||||||
Token* colon = condTop->astOperand2();
|
Token* colon = condTop->astOperand2();
|
||||||
forward(colon->astOperand1(), cond.vartok, thenValues, tokenlist, settings);
|
forward(colon->astOperand1(), cond.vartok, thenValues, tokenlist, settings);
|
||||||
|
|
|
@ -6442,6 +6442,9 @@ private:
|
||||||
" void f(std::array<T*, 2>& a);\n"
|
" void f(std::array<T*, 2>& a);\n"
|
||||||
"};\n";
|
"};\n";
|
||||||
valueOfTok(code, "a");
|
valueOfTok(code, "a");
|
||||||
|
|
||||||
|
code = "void f(const char * const x) { !!system(x); }\n";
|
||||||
|
valueOfTok(code, "x");
|
||||||
}
|
}
|
||||||
|
|
||||||
void valueFlowHang() {
|
void valueFlowHang() {
|
||||||
|
|
Loading…
Reference in New Issue