[Soot-list] duplicate subgraphs in CFG

Eric Bodden eric.bodden at mail.mcgill.ca
Thu Dec 4 19:43:19 EST 2008


The duplication is simply to implement the correct semantics. If you have...

try{
  foo();
} finally {
  bar();
}

... then you need something like ...

label1:
  foo();
label2:
  bar();
  return;
label3:
  e = @caughtexception;
  bar();
  throw e;

trap Throwable from label1 to label2 with label3;

... on the Jimple level because you want to execute bar() *regardless*
of the exception being thrown, but you obviously want to return *or*
throw depending on whether an exception was raised within the try
block. The label/location of the copied block therefore sort of
encodes the information "exception" or "no exception".

Eric



2008/12/4  <hsadat at gmail.com>:
> Hi,
>
> I was looking at the CFGs built in interactive mode using Soot Eclipse
> plugin and noticed that there are some duplicate subgraphs; specifically,
> the subgraph corresponding to "finally" block is repeated, one for the path
> from the end of the catch block and the other for the path from end of try
> block. Has anyone encountered this? and is there an explanation behind it?
>
> I tried to think of possible reasons for duplicating; because I know in the
> analysis context, some of the nodes are created to make later
> analysis/transformation easier (e.g. "nop" nodes).
>
> So, any clues?
>
> Thanks
>
> --Hossein
> _______________________________________________
> 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
Got an interesting job offer? http://www.bodden.de/hire-me/


More information about the Soot-list mailing list