NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Great, thanks!



================
Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:363-364
 
+  /// Check whether we do not model the memory allocation.
+  bool isNotModeled(const CallExpr *CE, CheckerContext &C) const;
+
----------------
One last thing: let's make it obvious what does the function do.
- It not only checks and returns a boolean value, it also adds transitions. It 
is very important to know that the function adds transitions so that to avoid 
accidental state splits.
- In this case we're talking about a deallocation rather than allocation.
- Technically, "not modeled" is not quite correct, as we *are* modeling it, 
just differently.

I suggest something like this:
```lang=c++
/// See if deallocation happens in a suspicious context. If so, escape the 
pointers
/// that otherwise would have been deallocated and return true.
bool suppressDeallocationsInSuspiciousContexts(const CallExpr *CE, 
CheckerContext &C) const;
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64680/new/

https://reviews.llvm.org/D64680



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to