This revision was automatically updated to reflect the committed changes.
Closed by commit rL289970: [analyzer] Fix crash in MallocChecker. (authored by
dcoughlin).
Changed prior to commit:
https://reviews.llvm.org/D27849?vs=81751&id=81774#toc
Repository:
rL LLVM
https://reviews.llvm
Author: dcoughlin
Date: Fri Dec 16 12:41:40 2016
New Revision: 289970
URL: http://llvm.org/viewvc/llvm-project?rev=289970&view=rev
Log:
[analyzer] Fix crash in MallocChecker.
Fix a crash in the MallocChecker when the extent size for the argument
to new[] is not known.
A patch by Abramo Bag
;
Dániel Krupp ; haoNoQ
Subject: Re: Crash in MallocChecker
+ Artem and Daniel,
Thanks for the patch! This fix seems reasonable to me, although it would good
to add the reproducer as test case! (tests/Analysis/malloc.cpp would be a fine
place for it).
Devin
> On Nov 30, 2016, at 4:10 PM, Abr
+ Artem and Daniel,
Thanks for the patch! This fix seems reasonable to me, although it would good
to add the reproducer as test case! (tests/Analysis/malloc.cpp would be a fine
place for it).
Devin
Index: lib/StaticAnalyzer/Checkers/MallocChecker.cpp
===
Please consider to review and apply the attached patch.
This is how to reproduce the bug:
abramo@tester:~$ cat bug.cpp
void f(int a, int b)
{
new char[a * b];
}
abramo@tester:~$ ~/llvm-build/bin/clang -cc1 -analyze
-analyzer-checker=cplusplus.NewDeleteLeaks bug.cpp
clang:
/home/abramo/llvm/to