Add another test case for PR 8015, here with the array index being within a valid range and not just a single constant.

llvm-svn: 112769
This commit is contained in:
Ted Kremenek 2010-09-01 23:37:36 +00:00
parent faa30f531a
commit 121ddd6a5c
1 changed files with 9 additions and 0 deletions

View File

@ -1116,3 +1116,12 @@ void pr8015_D_FIXME() {
}
}
void pr8015_E() {
// Similar to pr8015_C, but number is allowed to be a valid range.
int number = pr8015_A();
const char *numbers[] = { "zero", "one", "two" };
if (number < 3) {
pr8015_B(numbers[number]); // no-warning
}
}