From: Anton Yartsev Date: Wed, 10 Apr 2013 22:36:16 +0000 (+0000) Subject: [analyzer] +Testcase: several used-after-free args passed to a function. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=337ad7627ca82b1bcba37618d40129c3e59be86b;p=clang [analyzer] +Testcase: several used-after-free args passed to a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179232 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/NewDelete-checker-test.cpp b/test/Analysis/NewDelete-checker-test.cpp index 35125ccc8f..9c838aad76 100644 --- a/test/Analysis/NewDelete-checker-test.cpp +++ b/test/Analysis/NewDelete-checker-test.cpp @@ -114,6 +114,11 @@ void testUseLastArgAfterDelete(int *p) { f(0, 0, p); // expected-warning{{Use of memory after it is freed}} } +void testUseSeveralArgsAfterDelete(int *p) { + delete p; + f(p, p, p); // expected-warning{{Use of memory after it is freed}} +} + void testUseRefArgAfterDelete(SomeClass &c) { delete &c; g(c); // expected-warning{{Use of memory after it is freed}}