http://llvm.org/bugs/show_bug.cgi?id=12531
Bug #: 12531
Summary: Reverse loop order with variable upper boundary not
handled correctly by analyzer
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Consider this code:
void f(int j)
{
void *buf[j];
int i;
if (j < 0)
return;
for (i = 0; i < j; ++i)
buf[i] = malloc(100);
#if WORKING
for (i = 0; i < j; ++i)
#else
for (i = j - 1; i >= 0; ++i)
#endif
free(buf[i]);
}
The two for loops in the #if are equivalent, but the second triggers the "use
of potentially uninitialised memory" check.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs