Skip to content

Variables names in jimple (from Bytecode) with duplicate entries #30

@faustocarva

Description

@faustocarva

There is a bug in the Decompiler module that is creating duplicated variables names in some method bodies.
Sample Code:

package samples;
public class LongValueSample {
	public static void addLongValues() throws Exception {
		long x = 10L; 
		long y = 20L; 
		System.out.println(x + y);
	}
}

The Decompiler generates the code bellow:

    public static void addLongValues() throws java.lang.Exception
    {
        long $i2;
        long $i1;
        java.io.PrintStream $i2;
        long $i3;
     
        $i1 = 10L;
        $i2 = 20L;
        $i2 = <java.lang.System: java.io.PrintStream out>;
        $i3 = $i1 + $i2;
        virtualinvoke $i2.<java.io.PrintStream: void println(long)>($i3);
     
        return; 
    }

You can see the repeated usage of variable name $i2 (for a long and for java.io.PrintStream) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions