mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix bugs
This commit is contained in:
parent
3f7d02affb
commit
3935d27f5b
|
@ -286,7 +286,7 @@ public class Decompiler {
|
|||
Optimizer optimizer = new Optimizer();
|
||||
optimizer.optimize(methodNode, method.getProgram());
|
||||
methodNode.getModifiers().addAll(mapModifiers(method.getModifiers()));
|
||||
int paramCount = method.getSignature().length;
|
||||
int paramCount = Math.min(method.getSignature().length, program.variableCount());
|
||||
for (int i = 0; i < paramCount; ++i) {
|
||||
Variable var = program.variableAt(i);
|
||||
methodNode.getParameterDebugNames().add(new HashSet<>(var.getDebugNames()));
|
||||
|
|
|
@ -38,6 +38,7 @@ class UnusedVariableEliminator implements ExprVisitor, StatementVisitor {
|
|||
}
|
||||
indexes = new int[variableCount];
|
||||
Arrays.fill(indexes, -1);
|
||||
parameterCount = Math.min(parameterCount, indexes.length - 1);
|
||||
for (int i = 0; i <= parameterCount; ++i) {
|
||||
indexes[i] = lastIndex++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user