Files
clang-p2996/clang/test/Analysis/PR49642.c
Valeriy Savchenko 3085bda2b3 [analyzer][solver] Fix infeasible constraints (PR49642)
Additionally, this patch puts an assertion checking for feasible
constraints in every place where constraints are assigned to states.

Differential Revision: https://reviews.llvm.org/D98948
2021-03-22 11:02:02 +03:00

25 lines
386 B
C

// RUN: %clang_analyze_cc1 -w -verify %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions
// expected-no-diagnostics
typedef ssize_t;
b;
unsigned c;
int write(int, const void *, unsigned long);
a() {
d();
while (c > 0) {
b = write(0, d, c);
if (b)
c -= b;
b < 1;
}
if (c && c) {
// ^ no-crash
}
}