[Soot-list] Exception Analysis

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Oct 17 11:12:12 EDT 2007


Hi, Irem.

In fact it is true that *certain* exceptions can be thrown at every
single statement, e.g. exceptions of type OutOfMemoryError. The
default exception analysis encodes this soundly.

There is a constructor ExceptionalUnitGraph(Body,ThrowAnalysis) that
you can use to create an exceptional unit graph with a "real" throw
analysis. The default is a pedantic throw analysis, which causes your
problems:

http://www.sable.mcgill.ca/soot/doc/soot/toolkits/exceptions/PedanticThrowAnalysis.html

Eric

On 17/10/2007, irem at nada.kth.se <irem at nada.kth.se> wrote:
> Hello!
>
> I am using soot to perform control flow analysis. I use call graph and
> control flow graph given by soot to produce a special kind of control flow
> graph in my own format. I am using soot 2.2.4 version.
>
>
> In order to check if an exceptional termination is possible at a program
> point, I use  getExceptionDests to get the types of exceptions that can be
> thrown by the Unit in question in the ExceptionalUnitGraph. My problem is
> that it appears as if *all* program points can raise an exception of type
> Throwable. This in turn makes my own analysis imprecise.
>
> For instance:
>
> public void method(boolean b){
> try {
>      if (b)
>         {int a = 3/0;}
>      else
>         {throw new ArithmeticException();}
> }
> catch (ArithmeticException e){
>      method(false);
> }
> }
>
> For this example, at certain places I would have expected only
> ArithmeticException to be raised.
>
> I am wondering if I am skipping something here or if the analysis is meant
> to be this way.
>
> Thanks,
>
> Irem Aktug
> KTH, Sweden
>
>
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list