Merge ABCs on compile

TODO: reorder correctly
This commit is contained in:
Jindra Petřík
2016-08-16 06:44:48 +02:00
parent 0705a90aa0
commit 7c5d5eac58
2 changed files with 6 additions and 9 deletions

View File

@@ -507,6 +507,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
if (byteDelta != 0) {
code.updateInstructionByteCountByAddr(address, byteDelta, body);
}
body.setModified();
}
/**
@@ -525,6 +526,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
if (byteDelta != 0) {
code.updateInstructionByteCountByAddr(address, byteDelta, body);
}
body.setModified();
}
}

View File

@@ -158,16 +158,11 @@ public class As3ScriptReplacer extends MxmlcRunner {
} else {
//NOO
}
int oldTagIndex = swf.getTags().indexOf((Tag) oldPack.abc.parentTag);
oldPack.abc.pack(); // removes old classes/methods/scripts
if (oldPack.abc.script_info.isEmpty()) {
swf.removeTag(oldTagIndex);
}
ABCContainerTag lastTag = newTags.get(newTags.size() - 1);
((Tag) lastTag).setSwf(swf);
swf.addTag(oldTagIndex + 1, (Tag) lastTag);
//TODO: looks like ABCs need to be merged. Parent class needs to be defined earlier than used :-(
((Tag) lastTag).setModified(true);
ABCContainerTag newTagsLast = newTags.get(newTags.size() - 1);
ABC newLastAbc = newTagsLast.getABC();
oldPack.abc.mergeABC(newLastAbc);
//TODO: reorder classes
((Tag) oldPack.abc.parentTag).setModified(true);
}
} finally {