Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvts are unexpectedly dropped in certain cases #452

Open
Owen1212055 opened this issue Jan 11, 2025 · 0 comments
Open

lvts are unexpectedly dropped in certain cases #452

Owen1212055 opened this issue Jan 11, 2025 · 0 comments
Labels
Priority: High High priority Subsystem: Variables Anything concerning variables, types, assignments, and casting Type: Bug Something isn't working

Comments

@Owen1212055
Copy link
Contributor

LVTs appear to be dropped in certain situations due to LVT merging.

Source:

double one = 1;
double shouldBeOne = one;
one = 0;
if (one > 1) {
}

System.out.println(shouldBeOne); // -> 1.0

Decompiles to:

double one = 1.0;
one = 0.0;
if (one > 1.0) {
}

System.out.println(one); // -> 0.0

Notable Case

It should be noted that without the if statement, it appears to work fine.

// Decompiles to without if statement
double one = 1.0;
double var5 = 0.0; // <- although interestingly, this LVT name is lost
System.out.println(one);

A test has been added for this via #449 , this issue is just for tracking. :)

@jaskarth jaskarth added Type: Bug Something isn't working Priority: High High priority Subsystem: Variables Anything concerning variables, types, assignments, and casting labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High High priority Subsystem: Variables Anything concerning variables, types, assignments, and casting Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants