dcoughlin added inline comments.

================
Comment at: lib/StaticAnalyzer/Core/LoopWidening.cpp:149
@@ +148,3 @@
+      break;
+    }
+
----------------
This doesn't seem quite right. Consider:

```
int i;
for (i = 0; i < 21; i += 3) {}
clang_analyzer_eval(i == 23);
```
The value of `i` should be 21 after the loop, but this code sets it to 23. And 
what happens if `i` starts at 1 instead of 0?

Another (ridiculous) case to consider:

```
for (i = 0; i < 21; i += 3) {
  if (random() % 2 == 1) {
     i = i * i;
  } else {
    i--;
  }
}
```
What are the possible values of `i` after the loop?


http://reviews.llvm.org/D12358



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to