Skip to content

core is producing the wrong code by not including a cast #45

@jlholt

Description

@jlholt

I'm using JD-GUI 1.6.6.

I compile the following code with Java 1.8.

public static long l (int x, int y) {
long rc = ( (long)y << 32L) | x;
return rc;
}

But when I view the decompiled output, I see this:

public static long l(int x, int y) {
long rc = y << 32L | x;
return rc;
}

Given: x=1, y=2

When I execute the compiled source, I get a return code of 8589934593.

When I compile and execute the source from the decompiled class file, I get a return code of 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions