File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -1487,15 +1487,18 @@ class RangeConstraintManager : public RangedConstraintManager {
1487
1487
// This is an infeasible assumption.
1488
1488
return nullptr ;
1489
1489
1490
- ProgramStateRef NewState = setConstraint (State, Sym, NewConstraint);
1491
- if (auto Equality = EqualityInfo::extract (Sym, Int, Adjustment)) {
1492
- // If the original assumption is not Sym + Adjustment !=/</> Int,
1493
- // we should invert IsEquality flag.
1494
- Equality->IsEquality = Equality->IsEquality != EQ;
1495
- return track (NewState, *Equality);
1490
+ if (ProgramStateRef NewState = setConstraint (State, Sym, NewConstraint)) {
1491
+ if (auto Equality = EqualityInfo::extract (Sym, Int, Adjustment)) {
1492
+ // If the original assumption is not Sym + Adjustment !=/</> Int,
1493
+ // we should invert IsEquality flag.
1494
+ Equality->IsEquality = Equality->IsEquality != EQ;
1495
+ return track (NewState, *Equality);
1496
+ }
1497
+
1498
+ return NewState;
1496
1499
}
1497
1500
1498
- return NewState ;
1501
+ return nullptr ;
1499
1502
}
1500
1503
1501
1504
ProgramStateRef track (ProgramStateRef State, EqualityInfo ToTrack) {
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_analyze_cc1 -w -analyzer-checker=core -verify %s \
2
+ // RUN: -analyzer-config eagerly-assume=true
3
+
4
+ // expected-no-diagnostics
5
+
6
+
7
+ int test (unsigned long a , unsigned long c , int b ) {
8
+ c -= a ;
9
+ if (0 >= b ) {}
10
+ c == b ;
11
+ return c ? 0 : 2 ; // no-crash
12
+ }
You can’t perform that action at this time.
0 commit comments