Saving only modified ABC body code

Reading ABC code outside bounds fix
This commit is contained in:
Jindra Petřík
2014-09-24 17:42:44 +02:00
parent 92162124f5
commit f202a81ddc
5 changed files with 27 additions and 10 deletions

View File

@@ -189,8 +189,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi
if (text.trim().startsWith("#hexdata")) {
byte[] data = Helper.getBytesFromHexaText(text);
MethodBody mb = abc.bodies.get(bodyIndex);
mb.codeBytes = data;
mb.setCode(null);
mb.setCodeBytes(data);
} else {
AVM2Code acode = ASM3Parser.parse(new StringReader(text), abc.constants, trait, new MissingSymbolHandler() {
//no longer ask for adding new constants
@@ -214,7 +213,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi
return true;
}
}, abc.bodies.get(bodyIndex), abc.method_info.get(abc.bodies.get(bodyIndex).method_info));
acode.getBytes(abc.bodies.get(bodyIndex).codeBytes);
//acode.getBytes(abc.bodies.get(bodyIndex).getCodeBytes());
abc.bodies.get(bodyIndex).setCode(acode);
}
((Tag) abc.parentTag).setModified(true);