https://bugs.llvm.org/show_bug.cgi?id=32911

            Bug ID: 32911
           Summary: false positive report: clang SA falsely assumes that
                    the loop is executed 0 times
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: kreme...@apple.com
          Reporter: daniel.kr...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Since clang SA falsely assumes that the loop is executed 0 times
it reports "The left operand of '==' is a garbage value" for the following
code:

static unsigned size = 32;

int init(int *s);
void assert(int);

static void test(void)
{
 int val;
 if (size>10){
  for (unsigned j = 0; j<size+1; j++)
  init(&val);
 assert((int) (val == 1));//false positive report
 }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to