[llvm-bugs] [Bug 39134] New: CSA doesn't show all bugs in function

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 30 20:34:56 PDT 2018


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

            Bug ID: 39134
           Summary: CSA doesn't show all bugs in function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: zamazan4ik at tut.by
                CC: llvm-bugs at lists.llvm.org

I am testing Clang Static Analyzer (CSA) on this code sample:


int main()
{
    int* c = new int[10];
    free(c);

    int* d = new int;
    free(d);

    int* e = (int*)malloc(10);
    delete e;
}


For testing I have built clang from trunk and run analysis as
'./scan-build -k --use-analyzer=clang ./clang++ main.cpp'. Then I get
only one report about first bug:


 main.cpp:11:14: warning: Memory allocated by 'new[]' should be
deallocated by 'delete[]', not free()
    free(c);
    ^~~~~~~
1 warning generated.
scan-build: 1 bug found.


No information about errors on the next lines. When I comment first two
lines with bug, CSA is able to find next bug and so on.

-- 
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/20181001/e873d9a3/attachment.html>


More information about the llvm-bugs mailing list