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

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 1 01:03:25 PDT 2017


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

daniel.krupp at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from daniel.krupp at gmail.com ---
Daniel, Artem you are right.
The 0<size+1 can be false in the corner case when size==UINT_MAX.

Clang says this:

garbage.c:11:6: note: Loop condition is false. Execution continues on line 13
     for (unsigned j = 0; j<size+1; j++)

We could probably improve the output message by extending it by the assumptions
made on the variables in the conditions. So would be easier to understand what
assumptions are made by the analyzer.

Anyway the issue can be closed. Thanks.

-- 
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/20170601/10d59bf2/attachment.html>


More information about the llvm-bugs mailing list