Class ZeroTransformer

  • All Implemented Interfaces:
    Transformer

    public class ZeroTransformer
    extends StatedTransformer
    dex mix use as integer 0 and object null. the following code is validate in dex, but invalidate in .class
         a=0
         if x>0 goto L1
         L2: [b=phi(a,c)]
         useAsObject(b);
         c=getAnotherObject();
         goto L2:
         L1: [d=phi(a,e)]
         useAsInt(d);
         e=123
         goto L1:
     

    we transform the code to

         a1=0
         a=0
         if x>0 goto L1
         a2=0
         L2: [b=phi(a1,c)]
         useAsObject(b);
         c=getAnotherObject();
         goto L2:
         L1: [d=phi(a,e)]
         useAsInt(d);
         e=123
         goto L1: