]> granicus.if.org Git - clang/commit
More accurately model realloc() when the size argument is 0. realloc() with a size...
authorLenny Maiorani <lenny@colorado.edu>
Wed, 27 Apr 2011 14:49:29 +0000 (14:49 +0000)
committerLenny Maiorani <lenny@colorado.edu>
Wed, 27 Apr 2011 14:49:29 +0000 (14:49 +0000)
commit4d8d803b06804defe25346871c7beb6096540c4a
treee5863ddf62feaa30ddbaf596bb144352abe5d3f4
parent7ccc95bceebb2d1c8fbe277c9e33bde7dc1ccbb1
More accurately model realloc() when the size argument is 0. realloc() with a size of 0 is equivalent to free(). The memory region should be marked as free and not used again.

Unit tests f2_realloc_0(), f6_realloc(), and f7_realloc() contributed by Marshall Clow <mclow.lists@gmail.com>. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130303 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
test/Analysis/malloc.c