[PATCH] D12726: [analyzer] A fix for symbolic element region index lifetime.

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 04:24:59 PDT 2015


NoQ updated this revision to Diff 37094.
NoQ marked an inline comment as done.
NoQ added a comment.

> What are the implications in each case?


Uhm, sorry, right, I guess i have to admit i don't quite understand what exactly is going on, so it'd take more time for me to conduct a deeper audit of the reaping code to answer this question. In fact, right now i'm not even sure that

  // If the block expr's value is a memory region, then mark that region.
  if (Optional<loc::MemRegionVal> R = X.getAs<loc::MemRegionVal>())
    SymReaper.markLive(R->getRegion());

in EnvironmentManager::removeDeadBindings() does anything at all (at least, it's not covered by tests).

For now i just leave the patch here that fixes the tests with minimal intrusion (instead of patching markLive(), this diff patches only specific places), other issues you pointed out are fixed as well. Hopefully, will have time to dig into this in the nearest future :)

> > I don't notice any significant performance hit with this

> 

> >  patch (+/- 2% on the whole Android codebase runs).

> 

> 

> What did you test it on?


On the source code of the whole Android Open Source Project (version 5); i record analyzer commands after the first scan-build, so that not to rebuild Android for every analysis (and only substitute clang executable and set of checkers), and the observed time of analysis is 1 hour 6 minutes (expensive hardware...) both before and after the patch is applied, so the difference in time seems to be less than one minute, i.e. less than 2%. And i guess it should be large and varied enough(?)


http://reviews.llvm.org/D12726

Files:
  docs/analyzer/DebugChecks.rst
  include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
  lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
  lib/StaticAnalyzer/Core/Environment.cpp
  lib/StaticAnalyzer/Core/RegionStore.cpp
  lib/StaticAnalyzer/Core/SymbolManager.cpp
  test/Analysis/return-ptr-range.cpp
  test/Analysis/symbol-reaper.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12726.37094.patch
Type: text/x-patch
Size: 10128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151012/98a2dee7/attachment-0001.bin>


More information about the cfe-commits mailing list