]> granicus.if.org Git - clang/commitdiff
[analyzer] One more pointer escape test.
authorAnna Zaks <ganna@apple.com>
Fri, 4 May 2012 22:18:36 +0000 (22:18 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 4 May 2012 22:18:36 +0000 (22:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156214 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/malloc.cpp

index f36d8fcb7b24deba4e2a17fbab477a944d727011..72b92722133bd3948387e883dc8f8496e907b416 100644 (file)
@@ -24,3 +24,14 @@ void r11160612_3() {
   char *x = (char*)malloc(12);
   const_ptr_and_callback_def_param(0, x, 12);
 }
+
+// Test member function pointer.
+struct CanFreeMemory {
+  static void myFree(void*);
+};
+//This is handled because we look at the type of the parameter(not argument).
+void r11160612_3(CanFreeMemory* p) {
+  char *x = (char*)malloc(12);
+  const_ptr_and_callback_def_param(0, x, 12, p->myFree);
+}
+