зеркало из https://github.com/microsoft/clang-1.git
[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
This commit is contained in:
Родитель
55e57a50a3
Коммит
337ad7627c
|
@ -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}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче