[PATCH] D49656: [analyzer] Add support for more pointer invalidating functions in InnerPointerChecker

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 23 10:04:27 PDT 2018


xazax.hun added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp:207
 
-  if (mayInvalidateBuffer(Call)) {
-    if (const PtrSet *PS = State->get<RawPtrMap>(ObjRegion)) {
-      // Mark all pointer symbols associated with the deleted object released.
-      const Expr *Origin = Call.getOriginExpr();
-      for (const auto Symbol : *PS) {
-        // NOTE: `Origin` may be null, and will be stored so in the symbol's
-        // `RefState` in MallocChecker's `RegionState` program state map.
-        State = allocation_state::markReleased(State, Symbol, Origin);
-      }
-      State = State->remove<RawPtrMap>(ObjRegion);
-      C.addTransition(State);
-      return;
+void InnerPointerChecker::checkPreCall(const CallEvent &Call,
+                                       CheckerContext &C) const {
----------------
NoQ wrote:
> I believe that this should also go into `PostCall`. Symbols aren't released until some point //within// the call.
Oh, I see. But is it guaranteed that the symbols are not garbage collected until post call? Also, the environment will always contain all the bindings for the arguments?


Repository:
  rC Clang

https://reviews.llvm.org/D49656





More information about the cfe-commits mailing list