[LLVMbugs] [Bug 15790] New: MallocWithAnnotations should support annotating a realloc-like function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 19 03:46:30 PDT 2013


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

            Bug ID: 15790
           Summary: MallocWithAnnotations should support annotating a
                    realloc-like function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: bruce.r.stephens at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I'd expect something like the following to be possible (wrapping realloc).
It seems not to work.

#include <stdlib.h>

void *my_realloc(void *ptr, size_t size)
  __attribute__((ownership_takes(malloc,1)))
  __attribute__((ownership_returns(malloc,2)));

void
test()
{
  void *ptr = malloc(10);
  ptr = my_realloc(ptr, 11);
  free(ptr);
}

-- 
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/20130419/49e17a1c/attachment.html>


More information about the llvm-bugs mailing list