projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67291b9
)
Add a test that shows that reporting a leak after failure to free is
author
Anna Zaks
<ganna@apple.com>
Tue, 13 Nov 2012 03:34:49 +0000
(
03:34
+0000)
committer
Anna Zaks
<ganna@apple.com>
Tue, 13 Nov 2012 03:34:49 +0000
(
03:34
+0000)
tricky.
llvm-svn: 167814
clang/test/Analysis/malloc.mm
patch
|
blob
|
history
diff --git
a/clang/test/Analysis/malloc.mm
b/clang/test/Analysis/malloc.mm
index
34b3c33
..
99d1de8
100644
(file)
--- a/
clang/test/Analysis/malloc.mm
+++ b/
clang/test/Analysis/malloc.mm
@@
-245,9
+245,12
@@
void test12365078_no_malloc(unichar *characters) {
if (!string) {free(characters);}
}
-
void test12365078_false_negative_no_malloc
(unichar *characters) {
+
NSString *test12365078_no_malloc_returnValue
(unichar *characters) {
NSString *string = [[NSString alloc] initWithCharactersNoCopy:characters length:12 freeWhenDone:1];
- if (!string) {;}
+ if (!string) {
+ return 0; // no-warning
+ }
+ return string;
}
void test12365078_nocheck_nomalloc(unichar *characters) {