Interprocedural Analysis

Contents

  • Motivation
  • Call Graph Construction(CHA)
  • Interprocedural Control-Flow Graph
  • Interprocedural Data-Flow-Analysis

So far, all analyses we learned are intraprocedural. So how to deal with method calls ?

  • Make the most conservative assumption for method calls, for safe-approximation

Example. Const Propagation

void foo(){
    int n = ten();
    addOne(42);
}

int ten(){
    return 10;
}

int addOne(int x){
    int y = x + 1;
    return y;
}

We assume that :

n = NAC, x = NAC, y = NAC ==> too conservative and may cause imprecision

So for better precision, we need interprocedural analysis: propagate data-flow information along interprocedural control-flow edges.

Thus, to preform interprocedural analysis, we need call graph.