[analyzer] Calculate extent size for memory regions allocated by new expression.
authorGabor Horvath <xazax.hun@gmail.com>
Mon, 19 Sep 2016 20:39:52 +0000 (20:39 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Mon, 19 Sep 2016 20:39:52 +0000 (20:39 +0000)
commit7304027c6d8505598f5bbb58022109d33d1c926c
tree8dd4ebe48c018092e21cd98c88204f3b9332a2b6
parent3750c04f7e956bb24452556ca42ab3e2942a5b00
[analyzer] Calculate extent size for memory regions allocated by new expression.

ArrayBoundChecker did not detect out of bounds memory access errors in case an
array was allocated by the new expression. This patch resolves this issue.

Patch by Daniel Krupp!

Differential Revision: https://reviews.llvm.org/D24307

llvm-svn: 281934
clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
clang/test/Analysis/out-of-bounds-new.cpp [new file with mode: 0644]