[Soot-list] custom class loader

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Sun Jul 24 09:54:39 EDT 2011


Hi Phil.

> public class rootbeertest.BaseClass1 extends rootbeertest.BaseClass0
> {
>     protected int m_Shared;
>     public void <init>()
>     {
>         rootbeertest.BaseClass1 r0;
>         rootbeertest.BaseClass0 r1;
>
>         r0 := @this: rootbeertest.BaseClass1;
>         r1 = (rootbeertest.BaseClass0) r0;
>         specialinvoke r1.<rootbeertest.BaseClass0: void <init>()>();
>         r0.<rootbeertest.BaseClass1: int m_Shared> = 900;
>         return;
>     }

The problem with your code is that you are using an unititialized
object: the cast statement in the 2nd Jimple line accesses r0 on its
right-hand side. According to the JVM spec such an access is only
allowed after the object has been initialized (by the
super-constructor call).

But why the change in the code anyway? Apart from this low-level
problem the code appears equivalent to the original code?

Eric

-- 
Dr. Eric Bodden, http://bodden.de/
Principal Investigator in Secure Services at CASED
Coordinator of the CASED Advisory Board of Study Affairs
PostDoc at Software Technology Group, Technische Universität Darmstadt
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list