[LLVMbugs] [Bug 17954] New: False positive: Variable dependency not taken into account while analysing

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 15 20:35:47 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=17954

            Bug ID: 17954
           Summary: False positive: Variable dependency not taken into
                    account while analysing
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: prasannatsmkumar at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11552
  --> http://llvm.org/bugs/attachment.cgi?id=11552&action=edit
clang analyser report showing a false positive

I ran clang static analyser against Octave (octave.org) project. It reported a
lot of false positives.

Please see the report for the code and issue reported by clang analyser. It is
a false positive. Clang static analyser does not take care of dependency
between variables.

In this case variable 'pi' is null when 'val.pi' is null, non null when
'val.pi' is not null. When analysing the below snippet clang analyser reports
that "Null pointer passed as an argument to a 'nonnull' parameter"

---- code snippet ----

fn(const class1 &val)
    : pi(val.pi ? malloc(sieof(int)) : 0)
{
    if (pi) {
        memcpy(pi, val.pi, nbytes);
}

---- code snippet ----

The report shows a similar code. Please have a look at it.

-- 
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/20131116/ff0bd43e/attachment.html>


More information about the llvm-bugs mailing list