[llvm-bugs] [Bug 32911] New: false positive report: clang SA falsely assumes that the loop is executed 0 times

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 3 10:30:39 PDT 2017


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: kremenek at apple.com
          Reporter: daniel.krupp at gmail.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170503/51351e6e/attachment.html>


More information about the llvm-bugs mailing list