Fixed recently introduced assertion failure in debug mode

This commit is contained in:
PKEuS 2012-03-15 21:06:24 +01:00
parent b6057a1148
commit 4587a1a06c
2 changed files with 2 additions and 2 deletions

View File

@ -1173,7 +1173,7 @@ void CheckOther::checkIncorrectLogicOperator()
incorrectLogicOperatorError(term1Tok, text, conditions[i].error == AlwaysTrue);
} else {
const std::string text = "If " + cond1str + ", the comparison " + cond2str +
" is always " + ((conditions[i].error == SecondTrue || conditions[i].error == AlwaysTrue) ? "true" : "false") + ".\n";
" is always " + ((conditions[i].error == SecondTrue || conditions[i].error == AlwaysTrue) ? "true" : "false") + ".";
redundantConditionError(term1Tok, text);
}
break;

View File

@ -350,7 +350,7 @@ private:
c.assignmentInAssertError(0, "varname");
c.invalidScanfError(0);
c.incorrectLogicOperatorError(0, "foo > 3 && foo < 4", true);
c.redundantConditionError(0, "when first comparison is true, the 2nd comparison is always true");
c.redundantConditionError(0, "If x > 10 the condition x > 11 is always true.");
c.memsetZeroBytesError(0, "varname");
c.clarifyCalculationError(0, "+");
c.clarifyConditionError(0, true, false);