[Soot-list] EnclosingMethod attribute

Eric Bodden eric.bodden at ec-spride.de
Mon Sep 24 03:13:17 EDT 2012


Thanks a lot, I have merged your change.

Eric

On 21 September 2012 14:30, Devin Mahoney <devin.mahoney at kyrus-tech.com> wrote:
> I believe I have found an edge condition error in how Soot uses Jasmin
> to output assembled class files. The custom version of Jasmin
> distributed with Soot doesn't ever allow the EnclosingMethod attribute
> of an inner class to be zero.
>
> According to the Java class file spec [1], the EnclosingMethod
> attribute specifies "If the current class is not immediately enclosed
> by a method or constructor, then the value of the method_index item
> must be zero."
>
> While Soot correctly passes EnclosingMethod tags with an empty method
> (e.g. ".enclosing_method_attr " "myClass" "" ""\n" ), the custom
> Jasmin creates an empty string in the class' constant pool and makes a
> reference to that. [2]
>
> This bug was fixed at least as early as Jasmin version 2.0 [3].
>
> I have put in a proposed fix for this bug as a github pull request for
> the Sable/Jasmin project. This fix allows class files created by Soot
> to be processed by Android's dex library, which will otherwise reject
> anonymous inner classes that don't set the EnclosingMethod
> method_index to 0.
>
> Devin
>
> [1] http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.7
> [2] https://github.com/Sable/jasmin/blob/master/lib/jas/src/jas/EnclMethAttr.java
> [3] http://sourceforge.net/projects/jasmin/files/jasmin/2.0/
>
> --
> Devin Mahoney
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



-- 
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list