number of branches Lots of heuristics to keep the execution time reasonable Symbolic Execution Constraints on symbols represented as intervals Context Sensitive Function cloning (i.e.: „inlining” at the call site) Models memory Hierarchy Aliasing Works on large scale industrial projects
libaries The precision can be greatly improved when information loss is minimized Clang Static Analyzer does not support cross translation unit analysis Greater degree of information loss than necessary A fork have basic CTU implementation On some projects it can provide up to 3 times more results
Can not be solved in general due to macros Inherent problem of the C/C++ compilation model C++20 module system will solve this problem To utilize modules, semantic changes are required Most projects did not even catch up to C++11 Well behaved headers (e.g.: STL) can be deduplicated Type context of two translation units are not disjoint Type context merging on AST loading is necessary Large portion of the AST dumps is type information
Type information is necessary for parsing (resolve ambiguities in the grammar) In case a parsed AST is available, but the necessary type information is not, it is not possible to reason about the semantics of that piece of AST S (x); T ∗ y; func ((R) ∗ z); T T;
Restrictions? Yes! There is a lowest common denominator of type contexts that is available at every call site for a function! Types of the formal parameters Return type The type of the parent class for methods The minimal required type context for these types Summaries are a tool for interprocedural analysis Summarization of information about a function Use summaries of the original functions that only contain those permitted types!
engine unmodified Use summaries that only contain permitted types They can be stored efficiently No type information needs to be stored They can be loaded efficiently No type context merging is needed It is possible to synthesize them!
These summaries can aid symbolic execution to improve precision Efficient to store/load Implementation is available in Clang Proposed a scheme to synthesize summaries It can be used to achieve cross translation unit analysis without modifying the static analysis engine