PAMunb / JimpleFramework

A Rascal implementation of the Jimple framework.
13 stars 5 forks source link

Identity statement with incorrect local name #36

Open faustocarva opened 3 years ago

faustocarva commented 3 years ago

The identity statement of jimple is getting an incorrect value for local name. Sample code:

class O {
    public O f;
}
public class FooBar {
    public static void main(String[] args) {
        O p = new O();
        O q = p;
        O r = new O();
        p.f = r;
        O t = bar(q);
    }
    static O bar(O s) {
        return s.f;
    }
}

Output from the decompiler module (only for the bar method):

    static samples.pointsto.ex2.O bar(samples.pointsto.ex2.O) 
    {
        samples.pointsto.ex2.O r1;
        samples.pointsto.ex2.O $r1;     
        i1 := @parameter0: samples.pointsto.ex2.O;     
        $r1 = r1.<samples.pointsto.ex2.O: samples.pointsto.ex2.O f>;   
        return $r1; 
    }

As you can see, there is no i1 variable in this scope.