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: dcough...@apple.com
          Reporter: zamazan...@tut.by
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to