Fixed #6482 (False positive multiCondition)
This commit is contained in:
parent
b74b94b1e6
commit
d091639080
|
@ -286,7 +286,7 @@ static bool isOverlappingCond(const Token * const cond1, const Token * const con
|
|||
|
||||
const MathLib::bigint value1 = MathLib::toLongNumber(num1->str());
|
||||
const MathLib::bigint value2 = MathLib::toLongNumber(num2->str());
|
||||
return ((value1 & value2) == value2);
|
||||
return (value2 > 0 && (value1 & value2) == value2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -451,6 +451,12 @@ private:
|
|||
" else if (dynamic_cast<LABEL*>(widget)){}\n"
|
||||
"}",false);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f(int x) {\n" // #6482
|
||||
" if (x & 1) {}\n"
|
||||
" else if (x == 0) {}\n"
|
||||
"}",false);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void invalidMissingSemicolon() {
|
||||
|
|
Loading…
Reference in New Issue