[LLVMbugs] [Bug 15654] New: False positive: free() on a "constant" malloc()-ed address

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 2 04:14:11 PDT 2013


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

            Bug ID: 15654
           Summary: False positive: free() on a "constant" malloc()-ed
                    address
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: ranma42 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10276
  --> http://llvm.org/bugs/attachment.cgi?id=10276&action=edit
Reduced testcase

Running the latest checker (checker-272 (2013-03-01 14:12:07) ) on the attached
code, it incorrectly reports:

test-free.c:16:2: warning: Argument to free() is a constant address (42), which
is not memory allocated by malloc()

Although the address can be proved to be equal to a compile-time known constant
in one of the branches, it has actually been allocated by malloc(), so it
should not be reported as a problem in this case.

-- 
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/20130402/a72508bd/attachment.html>


More information about the llvm-bugs mailing list