fix: protect method from second load

This commit is contained in:
Skylot
2019-07-22 18:22:10 +03:00
parent 9fbf9ef667
commit 6b76a3c787
@@ -88,6 +88,7 @@ public class MethodNode extends LineAttrNode implements ILoadable, ICodeNode {
@Override
public void unload() {
regsCount = -1;
if (noCode) {
return;
}
@@ -106,6 +107,10 @@ public class MethodNode extends LineAttrNode implements ILoadable, ICodeNode {
@Override
public void load() throws DecodeException {
if (regsCount != -1) {
// method already loaded
return;
}
try {
if (noCode) {
regsCount = 0;