dcoughlin added a comment.
In https://reviews.llvm.org/D23375#527291, @andrewmw94 wrote:
> One more thing, obviously it should mimic malloc/free's behavior in
> complaining about delete/new being used. Should it also complain about
> free/malloc being used? I can't imagine that would be some
andrewmw94 added a comment.
One more thing, obviously it should mimic malloc/free's behavior in complaining
about delete/new being used. Should it also complain about free/malloc being
used? I can't imagine that would be something people would usually intend to
do, but I don't think it's rea
dcoughlin added a comment.
I would recommend putting the tests in existing test files next to tests that
for similar diagnostics for other allocation/free schemes. So the test for
printExpectedAllocName() should go in test/Analysis/free.c and the test for
printExpectedDeallocName() should proba
andrewmw94 added a comment.
I agree that more tests would be good. Where should I put them? Should it be
in a separate file or should I just have kmalloc/kfree tests next to the
malloc/free ones?
https://reviews.llvm.org/D23375
___
cfe-commits ma
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:593
@@ -590,1 +592,3 @@
+ if (FunI == II_free || FunI == II_realloc ||
+ FunI == II_reallocf || FunI == II_kfree)
return true;
It looks like you are us
dcoughlin removed rL LLVM as the repository for this revision.
dcoughlin updated this revision to Diff 67862.
dcoughlin added a comment.
Merge the two patches into one diff.
https://reviews.llvm.org/D23375
Files:
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
test/Analysis/kmalloc-linux.c
I
dcoughlin commandeered this revision.
dcoughlin edited reviewers, added: andrewmw94; removed: dcoughlin.
dcoughlin added a comment.
Thanks for the patches! I've commandeered this revision to be able to update
the diff to merge the two patch files into one. You should commandeer it back
by using
andrewmw94 updated this revision to Diff 67610.
andrewmw94 added a comment.
Change the test file kmalloc-linux.c to use kfree( ). Sorry if there was a way
to put both patch files together; I wasn't able to find one.
Repository:
rL LLVM
https://reviews.llvm.org/D23375
Files:
kmalloc-linux
andrewmw94 created this revision.
andrewmw94 added reviewers: zaks.anna, dcoughlin, dergachev.a.
andrewmw94 added a subscriber: cfe-commits.
andrewmw94 set the repository for this revision to rL LLVM.
andrewmw94 added a project: clang-c.
Adds the kfree( ) function to MallocChecker.cpp
Repository: