Fix 10548: FP knownConditionTrueFalse with loop and operator++ (#3511)
This commit is contained in:
parent
89515600e4
commit
7f04658585
|
@ -417,7 +417,8 @@ struct ForwardTraversal {
|
|||
actions |= allAnalysis;
|
||||
// do while(false) is not really a loop
|
||||
if (checkElse && isDoWhile &&
|
||||
(condTok->hasKnownIntValue() || (!bodyAnalysis.isModified() && condAnalysis.isRead()))) {
|
||||
(condTok->hasKnownIntValue() ||
|
||||
(!bodyAnalysis.isModified() && !condAnalysis.isModified() && condAnalysis.isRead()))) {
|
||||
if (updateRange(endBlock->link(), endBlock) == Progress::Break)
|
||||
return Break();
|
||||
return updateRecursive(condTok);
|
||||
|
|
|
@ -3793,6 +3793,13 @@ private:
|
|||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #10548
|
||||
check("void f() {\n"
|
||||
" int i = 0;\n"
|
||||
" do {} while (i++ == 0);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void alwaysTrueSymbolic()
|
||||
|
|
Loading…
Reference in New Issue