diff options
author | Gabor Horvath <xazax.hun@gmail.com> | 2019-01-29 10:27:14 +0000 |
---|---|---|
committer | Gabor Horvath <xazax.hun@gmail.com> | 2019-01-29 10:27:14 +0000 |
commit | f41e3d087344c1eeac25918c99a6a72c746df533 (patch) | |
tree | 2b2a996c0e1390466a72c62ffbb14a3522278094 /clang/test/Analysis/malloc.c | |
parent | 5c33c5da1ada960f3de0323967bd5df777a02eb9 (diff) | |
download | bcm5719-llvm-f41e3d087344c1eeac25918c99a6a72c746df533.tar.gz bcm5719-llvm-f41e3d087344c1eeac25918c99a6a72c746df533.zip |
[analyzer] Toning down invalidation a bit
When a function takes the address of a field the analyzer will no longer
assume that the function will change other fields of the enclosing structs.
Differential Revision: https://reviews.llvm.org/D57230
llvm-svn: 352473
Diffstat (limited to 'clang/test/Analysis/malloc.c')
-rw-r--r-- | clang/test/Analysis/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c index 8e0f5c04ca2..d4a44c57624 100644 --- a/clang/test/Analysis/malloc.c +++ b/clang/test/Analysis/malloc.c @@ -1758,8 +1758,8 @@ void constEscape(const void *ptr); void testConstEscapeThroughAnotherField() { struct IntAndPtr s; s.p = malloc(sizeof(int)); - constEscape(&(s.x)); // could free s->p! -} // no-warning + constEscape(&(s.x)); +} // expected-warning {{Potential leak of memory pointed to by 's.p'}} // PR15623 int testNoCheckerDataPropogationFromLogicalOpOperandToOpResult(void) { |