https://bugs.llvm.org/show_bug.cgi?id=49642

            Bug ID: 49642
           Summary: RangeConstraintManager areFeasible(Constraints) false,
                    assertion failure
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

There was a similar bug https://bugs.llvm.org/show_bug.cgi?id=49490, which was
fixed by D98341.
Fortunately, that introduced an assertion, which was triggered by the following
code.
Maybe the related revision did not fix the root cause of this bug?

test.c:
```lang=c
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) {
    //     ^ crash
  }
}
```

clang --analyze -Xclang -analyzer-checker=core test.c

The bug originally was found by analyzing the Twin project and reduced using
reduce.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to