summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-08-15 17:22:06 +0000
committerJordan Rose <jordan_rose@apple.com>2013-08-15 17:22:06 +0000
commit68502e52938f84b97267b51e86d4a90a11552512 (patch)
tree878cbde7948bbd3d7ed9794051eaa91f99246d05 /lib/CodeGen/CGExpr.cpp
parenta44f03bced45059e7c4c7043992db3b4657032c2 (diff)
downloadclang-68502e52938f84b97267b51e86d4a90a11552512.tar.gz
clang-68502e52938f84b97267b51e86d4a90a11552512.tar.bz2
clang-68502e52938f84b97267b51e86d4a90a11552512.tar.xz
[analyzer] If realloc fails on an escaped region, that region doesn't leak.
When a region is realloc()ed, MallocChecker records whether it was known to be allocated or not. If it is, and the reallocation fails, the original region has to be freed. Previously, when an allocated region escaped, MallocChecker completely stopped tracking it, so a failed reallocation still (correctly) wouldn't require freeing the original region. Recently, however, MallocChecker started tracking escaped symbols, so that if it were freed we could check that the deallocator matched the allocator. This broke the reallocation model for whether or not a symbol was allocated. Now, MallocChecker will actually check if a symbol is owned, and only require freeing after a failed reallocation if it was owned before. PR16730 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions