When running the analyzer against OpenAFS git master, vlserver/vl_utils.c reports a false uninitialized argument as shown here: http://hergotha.csail.mit.edu/~analyzer/2012-07-20-1/report-8QtTSW.html#EndPath If nextblockindex == blockindex is false (#3), then clearly the loop must execute at least once (#4), causing prevblockindex to be initialized (line 929). clang version 3.1 (branches/release_31) Target: amd64-portbld-freebsd8.3 Thread model: posix
Reproducible with: int foo(int y, int z) { int x; if (y == z) { x = 0; } else { if (y != z) { x = 1; } } return x; } Cloned to radar://11928676
Here's a similar one with less/greater: int *test(int x, int y) { int i; if (x >= y) { i = 0; } else { if (x < y) { i = 1; } } return i; } And with a while-loop instead: int *test(int x, int y) { int i; if (x >= y) { i = 0; } while (x < y) { i = 1; break; } return i; }
This could be addressed with alpha-renaming. Opened radar://12447480 for internal tracking.
Actually, this is already tracked by radar://7670487
*** Bug 27674 has been marked as a duplicate of this bug. ***
Confirmed. Proposed a fix https://reviews.llvm.org/D78933
Fixed by https://reviews.llvm.org/D78933