]> granicus.if.org Git - clang/commit
[analyzer] MIGChecker: Fix an FN when the object is released in a destructor.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 22 Feb 2019 00:09:56 +0000 (00:09 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 22 Feb 2019 00:09:56 +0000 (00:09 +0000)
commitd7535ee5c9f202dbda1df2b8672dff9d9f5fade3
treee4a633a6db92a22f707a82460e254ee25637a52a
parent46ca8eecbe17c8864b89d038a4f02d8a05024f55
[analyzer] MIGChecker: Fix an FN when the object is released in a destructor.

When a MIG server routine argument is released in an automatic destructor,
the Static Analyzer thinks that this happens after the return statement, and so
the violation of the MIG convention doesn't happen.

Of course, it doesn't quite work that way, so this is a false negative.

Add a hack that makes the checker double-check at the end of function
that no argument was released when the routine fails with an error.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354642 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MIGChecker.cpp
test/Analysis/mig.mm