[Soot-list] extra temp variables in jimple code

Jack Traror jacktraror at yahoo.com
Thu Aug 24 04:45:47 EDT 2017


Hello

In the jimple code which is in the end of this message, tmp$713250488 represents the variable g defined at the 2nd line in the following test case. However, this variable changes to tmp$15916637 at the 3rd line. Why is that happening?



@Test

public void testBarcodeIsDrawnAtOriginForZeroZeroDraw() throws Exception {

 BarcodeMock barcode = new BarcodeMock("12345");

 GraphicsMock g = new GraphicsMock();// 2nd line

 barcode.paintComponent(g);  // 3rd line 

 assertEquals(0, (int) g.getModifiedBounds().getX());

 assertEquals(0, (int) g.getModifiedBounds().getY());

}

protected void paintComponent(java.awt.Graphics g) {

super.paintComponent(g);

Insets insets = getInsets();

try {

draw((Graphics2D) g, insets.left, insets.top);

  } catch (OutputException e) {

// Don't draw anything

}

}


class GraphicsMock extends java.awt.Graphics2D {

 ...

}


public void testBarcodeIsDrawnAtOriginForZeroZeroDraw() throws java.lang.Exception
    {
        net.sourceforge.barbecue.BarcodeTest this;
        java.awt.Rectangle $r2, $r3;
        double $d0, $d1;
        int $i0, $i1;
        net.sourceforge.barbecue.BarcodeTest$BarcodeMock tmp$1950524369;
        net.sourceforge.barbecue.GraphicsMock tmp$713250488;
        java.awt.Graphics tmp$15916637;

        this := @this: net.sourceforge.barbecue.BarcodeTest;

        tmp$1950524369 = new net.sourceforge.barbecue.BarcodeTest$BarcodeMock;

        specialinvoke tmp$1950524369.<net.sourceforge.barbecue.BarcodeTest$BarcodeMock: void <init>(net.sourceforge.barbecue.BarcodeTest,java.lang.String)>(this, "12345");

        tmp$713250488 = new net.sourceforge.barbecue.GraphicsMock;

        specialinvoke tmp$713250488.<net.sourceforge.barbecue.GraphicsMock: void <init>()>();

        tmp$15916637 = (java.awt.Graphics) tmp$713250488;

        virtualinvoke tmp$1950524369.<net.sourceforge.barbecue.BarcodeTest$BarcodeMock: void paintComponent(java.awt.Graphics)>(tmp$15916637);

        $r2 = virtualinvoke tmp$713250488.<net.sourceforge.barbecue.GraphicsMock: java.awt.Rectangle getModifiedBounds()>();

        $d0 = virtualinvoke $r2.<java.awt.Rectangle: double getX()>();

        $i0 = (int) $d0;

        staticinvoke <net.sourceforge.barbecue.BarcodeTest: void assertEquals(int,int)>(0, $i0);

        $r3 = virtualinvoke tmp$713250488.<net.sourceforge.barbecue.GraphicsMock: java.awt.Rectangle getModifiedBounds()>();

        $d1 = virtualinvoke $r3.<java.awt.Rectangle: double getY()>();

        $i1 = (int) $d1;

        staticinvoke <net.sourceforge.barbecue.BarcodeTest: void assertEquals(int,int)>(0, $i1);

        return;
    } 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20170824/417653bb/attachment.html>


More information about the Soot-list mailing list