[Soot-list] unreachable code in jimple files?

Martin Schäf martinschaef at gmail.com
Thu Aug 28 12:49:10 EDT 2014


Unfortunately not ... but I'm still using soot-2.5 (because of this line
number issue I mentioned earlier). However, it looks like the result for
the current version is the same.

Cheers,
M


On Thu, Aug 28, 2014 at 9:18 AM, Bodden, Eric <eric.bodden at sit.fraunhofer.de
> wrote:

> Hi Martin.
>
> Was this fixed with the patch you submitted today?
>
> Cheers,
> Eric
>
> On 28.08.2014, at 04:34, Martin Schäf <martinschaef at gmail.com> wrote:
>
> > Hi,
> > I'm building this tool to detect contradictions in code and I'm trying
> to get rid of my false positives.
> > However, there seems to be some odd unreachable code in the jimple file
> generated for try-catch with resources.
> > Here is the Java program:
> >     public void ex06(String name) throws Exception {
> >       File config = new File(name);
> >         try (FileOutputStream fos = new FileOutputStream(config);
> >                 PrintWriter writer = new PrintWriter(new
> OutputStreamWriter(
> >                         fos , "rw"))) {
> >             bar();
> >         }
> >     }
> > The jimple output generated from the class file is attached. If you look
> at the lines starting from 109, you have:
> >      label21:
> >         $r24 := @caughtexception;
> >
> >      label22:
> >         r25 = $r24;
> >         r5 = r25;
> >         throw r25;
> >
> >      label23:
> >         $r26 := @caughtexception;
> >         r11 = $r26;
> >
> >      label24:
> >         if r4 == null goto label29;
> >
> >         if r5 == null goto label28;
> > Where r5 is clearly non-null and thus the "goto label28" is unreachable.
> >
> > Earlier in the code there is a chance to reach label23 with r5==null
> through an exception. Unfortunately, that is preceded by another trap, so
> the edge is ignored:
> >
> >         catch java.lang.Throwable from label0 to label16 with label21;
> >         catch java.lang.Throwable from label0 to label16 with label23;
> >
> > Is this something I have to live with or is there an easy way around?
> For some reason the NullnessAnalysis doesn't catch that either ... probably
> there is an infeasible edge in the exceptional unit graph.
> >
> > Cheers,
> > Martin
> >
> >
> >
> > <example.txt>_______________________________________________
> > Soot-list mailing list
> > Soot-list at CS.McGill.CA
> > https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
> --
> Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
> Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and
> EC SPRIDE
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140828/ed0fa842/attachment-0001.html 


More information about the Soot-list mailing list