[PATCH] D54013: [analyzer] MallocChecker: Avoid redundant transitions.

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 10:46:28 PST 2018

george.karpenkov added inline comments.

Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:2369
   ProgramStateRef state = C.getState();
-  RegionStateTy RS = state->get<RegionState>();
+  RegionStateTy OldRS = state->get<RegionState>();
   RegionStateTy::Factory &F = state->get_context<RegionState>();
Szelethus wrote:
> We are acquiring an object of type `ImmutableMap`, modify it, and put it back into `state`? Can't we just modify it through `ProgramState`'s interface directly?
state is immutable, I don't think we can put anything into it.
We also can't modify ImmutableMap because, well, it's immutable.

  rC Clang


More information about the cfe-commits mailing list