[llvm-bugs] [Bug 44036] New: False positive "Assigned value is garbage or undefined"

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 17 23:28:31 PST 2019


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

            Bug ID: 44036
           Summary: False positive "Assigned value is garbage or
                    undefined"
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: nils.judzinsky at igd-r.fraunhofer.de
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

Created attachment 22830
  --> https://bugs.llvm.org/attachment.cgi?id=22830&action=edit
output of clang-static-analyzer

The clang analyzer complains that garbage is assigned to the variable
valueLower in line 71. In my opinion, this is impossible. Line 30 and 69
contain checks that halfNumCheckpoints is not 0. So line 71 cannot be a
division by 0. valueLower is (allowed to be) 0. Given n != 0, 0/n == 0 , which
is not undefined.

Note that clang analyzer does not complain when lines 57-67 are commented out.
This is strange, as they have no effect on the computation in line 71.

clang-static-analyzer was run on Ubuntu 18.04 LTS. The exact version is in
index.html. OpenCV is required to build the program.

-- 
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/20191118/b413e34e/attachment.html>


More information about the llvm-bugs mailing list