diff options
| author | 2020-03-20 13:48:38 -0400 | |
|---|---|---|
| committer | 2020-03-20 13:48:38 -0400 | |
| commit | aaa79a0b5d675e341c085b8743a3493c32784b1b (patch) | |
| tree | f3fcc76961b1b5e1aa981c213eba0e470d9d34f0 /src/main/java/cuchaz/enigma/source/cfr | |
| parent | Add support for reading/writing zipped mappings (#199) (diff) | |
| parent | Fix CFR-related bugs (diff) | |
| download | enigma-fork-aaa79a0b5d675e341c085b8743a3493c32784b1b.tar.gz enigma-fork-aaa79a0b5d675e341c085b8743a3493c32784b1b.tar.xz enigma-fork-aaa79a0b5d675e341c085b8743a3493c32784b1b.zip | |
Merge pull request #203 from Runemoro/fix-cfr
Fix CFR-related bugs
Diffstat (limited to 'src/main/java/cuchaz/enigma/source/cfr')
| -rw-r--r-- | src/main/java/cuchaz/enigma/source/cfr/EnigmaDumper.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/cuchaz/enigma/source/cfr/EnigmaDumper.java b/src/main/java/cuchaz/enigma/source/cfr/EnigmaDumper.java index b9cdbea..e265d9d 100644 --- a/src/main/java/cuchaz/enigma/source/cfr/EnigmaDumper.java +++ b/src/main/java/cuchaz/enigma/source/cfr/EnigmaDumper.java | |||
| @@ -82,7 +82,7 @@ public class EnigmaDumper implements Dumper { | |||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | private MethodEntry getMethodEntry(MethodPrototype method) { | 84 | private MethodEntry getMethodEntry(MethodPrototype method) { |
| 85 | if (method.getClassType() == null) { | 85 | if (method == null || method.getClassType() == null) { |
| 86 | return null; | 86 | return null; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| @@ -97,7 +97,7 @@ public class EnigmaDumper implements Dumper { | |||
| 97 | private LocalVariableEntry getParameterEntry(MethodPrototype method, int parameterIndex, String name) { | 97 | private LocalVariableEntry getParameterEntry(MethodPrototype method, int parameterIndex, String name) { |
| 98 | int variableIndex = method.isInstanceMethod() ? 1 : 0; | 98 | int variableIndex = method.isInstanceMethod() ? 1 : 0; |
| 99 | for (int i = 0; i < parameterIndex; i++) { | 99 | for (int i = 0; i < parameterIndex; i++) { |
| 100 | variableIndex += method.getArgs().get(parameterIndex).getStackType().getComputationCategory(); | 100 | variableIndex += method.getArgs().get(i).getStackType().getComputationCategory(); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | return new LocalVariableEntry(getMethodEntry(method), variableIndex, name, true, null); | 103 | return new LocalVariableEntry(getMethodEntry(method), variableIndex, name, true, null); |