[Soot-list] unreachable code in jimple files?
Martin Schäf
martinschaef at gmail.com
Mon Sep 1 23:37:12 EDT 2014
One more mail and I'll stop spamming... I put the question on Stackoverflow:
http://stackoverflow.com/questions/25615417/try-with-resources-introduce-unreachable-bytecode
The problem is already in the bytecode. The exception table says something
like
21 135 170 Class java/lang/Throwable
21 135 179 any
Is there a good reason why the second line is not useless?
On Mon, Sep 1, 2014 at 3:14 PM, Martin Schäf <martinschaef at gmail.com> wrote:
> Oh, and btw, the problem only occurs if I run soot on the .class file and
> not for the .java file.
>
>
> On Mon, Sep 1, 2014 at 11:36 AM, Martin Schäf <martinschaef at gmail.com>
> wrote:
>
>> Nope, that doesn't help. If we go back to the Jimple snippet from my
>> earlier emails, the problem seems to be that you have these two traps:
>> catch java.lang.Throwable from label0 to label16 with label21;
>> catch java.lang.Throwable from label0 to label16 with label23;
>> where the latter is technically unreachable but seems to be considered in
>> the dataflow analysis. In this code (pasted below), if you jump to label21,
>> the check r25==null is trivial. However, if you would jump directly to
>> label23, you could reach r5==null where it is actually true.
>> So the problem seems to be that there are infeasible edges in the
>> exceptional unit graph (which could be weeded out) ...
>>
>> 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;
>>
>>
>> On Mon, Sep 1, 2014 at 9:35 AM, Bodden, Eric <
>> eric.bodden at sit.fraunhofer.de> wrote:
>>
>>> > Hmmm, so are you actually running a transformation that evaluates the
>>> nullness information to turn checks like if(r4==null) into if(false)?
>>>
>>> I just checked... specifically that would be
>>> soot.jimple.toolkits.annotation.nullcheck.NullCheckEliminator. Are you
>>> running this one? And it shows no effect on this code?
>>>
>>> Cheers,
>>> Eric
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140901/ea88d7a4/attachment.html
More information about the Soot-list
mailing list