-
Couldn't load subscription status.
- Fork 110
Open
Labels
Priority: MediumMedium priorityMedium prioritySubsystem: VariablesAnything concerning variables, types, assignments, and castingAnything concerning variables, types, assignments, and castingType: BugSomething isn't workingSomething isn't working
Description
Vineflower version
1.11.1
Describe the bug
Conflicting LVT's within inner classes can cause variable references to reference the wrong variable
Additional information
The JAR file enclosed in the above zip generates the following code when decompiled:
public class Util {
public static <T, R> Function<T, R> memoize(final Function<T, R> $$0) {
return new Function<T, R>() {
private final Map<T, R> cache = new ConcurrentHashMap<>();
@Override
public R apply(T $$0x) {
return this.cache.computeIfAbsent($$0, $$0);
}
};
}
}The first parameter to computeIfAbsent should be $$0x (the apply parameter), not $$0 (the function parameter in the enclosing method). The parameter's name in the LVT for the apply method is $$0, but because it conflicted with an outside variable, Vineflower renamed it to $$0x, but it didn't rename it's usage.
Metadata
Metadata
Assignees
Labels
Priority: MediumMedium priorityMedium prioritySubsystem: VariablesAnything concerning variables, types, assignments, and castingAnything concerning variables, types, assignments, and castingType: BugSomething isn't workingSomething isn't working