-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:static analyzerduplicateResolved as duplicateResolved as duplicate
Description
Bugzilla Link | 14797 |
Resolution | DUPLICATE |
Resolved on | Feb 22, 2013 18:57 |
Version | trunk |
OS | Linux |
CC | @belkadan |
Extended Description
Apparently the analyzers data flow analysis apparently gets confused by loops which count downwards. Below is a small testcase, which works fine when the first loop is changed to increment. As is the static analyzer claims uninitialized values in the second loop;
#include <assert.h>
void foo(int len)
{
int a[5], b;
assert((len > 0) && (len <= 5));
for (int i = len-1; i >= 0; i--)
a[i] = 0;
for (int i = len-1; i >= 0; i--)
b = a[i];
}
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:static analyzerduplicateResolved as duplicateResolved as duplicate