[Soot-list] Reachability in CFGs

irem irem at nada.kth.se
Sun Nov 4 13:54:22 EST 2007


First of all, thanks for the suggestions on visualizing the control flow
graphs.

Actually, the reason I was interested in various predecessors and
successors of nodes in control graphs is that I am interested in
reachability. 

If we look at the following example:

m1();

try {
m2();
}
catch (Exception e){
m3();
}


A property such as "method m2 is always called before m3" holds for this
program. But Soot constructs CFGs which concentrate on completed
executions, hence there is an edge from the predecessor of the statement
which calls m2 to the exception handler and it seems as if one can end
up in the handler without calling m2. 

I think this was not the case for certain earlier versions, and I
inherited a code that worked fine with them. But now I have to
manipulate the CFGs given by soot to reflect reachability better.

Anyway, right now, what I do is to construct the ExceptionalUnitGraph,
and check 
for each node in the graph:
 	for each of its exceptional successors in the graph:
		whether the successor is a handler unit for one of the 
		ExceptionalDests of the node
		if this is so, 
			I keep the edge between the node and successor 
		else
			I delete the edge



I have not tested this enough to see if it is correct. What does
everyone think? 
And would you think of integrating such an alternative graph to soot,
i.e. through some option? I think many people may be interested in it.

Irem Aktug
Ph.D. Student
Stockholm, Sweden




More information about the Soot-list mailing list