File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,8 @@ struct ValueFlowAnalyzer : Analyzer {
528528 continue ;
529529 if (exact && v.intvalue != 0 && !isPoint)
530530 continue ;
531+ if (astIsUnsigned (tok) != astIsUnsigned (v.tokvalue ))
532+ continue ;
531533 std::vector<MathLib::bigint> r;
532534 ValueFlow::Value::Bound bound = currValue->bound ;
533535 if (match (v.tokvalue )) {
Original file line number Diff line number Diff line change @@ -4968,6 +4968,13 @@ class TestCondition : public TestFixture {
49684968 " }\n "
49694969 " }\n " );
49704970 ASSERT_EQUALS (" " , errout_str ());
4971+
4972+ check (" void f(unsigned x) {\n " // #13522
4973+ " unsigned u = x;\n "
4974+ " int i = u - 0;\n "
4975+ " if (i < 0) {}\n "
4976+ " }\n " );
4977+ ASSERT_EQUALS (" " , errout_str ());
49714978 }
49724979
49734980 void alwaysTrueInfer () {
You can’t perform that action at this time.
0 commit comments