mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-10 12:06:23 +00:00
Fixed #2162 Debugger - ignore (warn) invalid jumps when injecting debug info
This commit is contained in:
@@ -84,6 +84,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#2143] FLA Export / Sound playback - taking MP3 initial latency into account
|
||||
- [#2153] FLA Export - sound streams were limited to first stream block
|
||||
- [#2163] FLA Export - maintain sound export settings for streams
|
||||
- [#2162] Debugger - ignore (warn) invalid jumps when injecting debug info
|
||||
|
||||
### Changed
|
||||
- [#2120] Exported assets no longer take names from assigned classes if there is more than 1 assigned class
|
||||
@@ -3366,6 +3367,7 @@ Major version of SWF to XML export changed to 2.
|
||||
[#2143]: https://www.free-decompiler.com/flash/issues/2143
|
||||
[#2153]: https://www.free-decompiler.com/flash/issues/2153
|
||||
[#2163]: https://www.free-decompiler.com/flash/issues/2163
|
||||
[#2162]: https://www.free-decompiler.com/flash/issues/2162
|
||||
[#2120]: https://www.free-decompiler.com/flash/issues/2120
|
||||
[#1130]: https://www.free-decompiler.com/flash/issues/1130
|
||||
[#1220]: https://www.free-decompiler.com/flash/issues/1220
|
||||
|
||||
@@ -544,6 +544,7 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
}
|
||||
|
||||
for (int bodyIndex : bodyToPosToLine.keySet()) {
|
||||
System.err.println("bi="+bodyIndex);
|
||||
List<AVM2Instruction> delIns = new ArrayList<>();
|
||||
|
||||
MethodBody b = abc.bodies.get(bodyIndex);
|
||||
@@ -605,6 +606,9 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
if (addedLines.contains(line)) {
|
||||
continue;
|
||||
}
|
||||
if (!origPosToNewPos.containsKey(i + dpos)) {
|
||||
continue;
|
||||
}
|
||||
addedLines.add(line);
|
||||
logger.log(Level.FINE, "Script {0}: Insert debugline({1}) at pos {2} to body {3}", new Object[]{path, line, i, bodyIndex});
|
||||
code2.add(origPosToNewPos.get(i + dpos), new AVM2Instruction(0, AVM2Instructions.DebugLine, new int[]{line}));
|
||||
@@ -634,20 +638,32 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
int changedOperand;
|
||||
if (ins.definition instanceof IfTypeIns) {
|
||||
targetAddr = ins.getTargetAddress();
|
||||
changedAddr = mapOffsets.get(targetAddr);
|
||||
changedOperand = (int) (changedAddr - adr - 4);
|
||||
ins.operands[0] = changedOperand;
|
||||
if (mapOffsets.containsKey(targetAddr)) {
|
||||
changedAddr = mapOffsets.get(targetAddr);
|
||||
changedOperand = (int) (changedAddr - adr - 4);
|
||||
ins.operands[0] = changedOperand;
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Invalid jump target in script {0}, bodyIndex {1}", new Object[]{toString(), bodyIndex});
|
||||
}
|
||||
}
|
||||
if (ins.definition instanceof LookupSwitchIns) {
|
||||
targetAddr = ins.getAddress() + ins.operands[0];
|
||||
changedAddr = mapOffsets.get(targetAddr);
|
||||
changedOperand = (int) (changedAddr - adr);
|
||||
ins.operands[0] = changedOperand;
|
||||
for (int k = 2; k < ins.operands.length; k++) {
|
||||
targetAddr = ins.getAddress() + ins.operands[k];
|
||||
if (mapOffsets.containsKey(targetAddr)) {
|
||||
changedAddr = mapOffsets.get(targetAddr);
|
||||
changedOperand = (int) (changedAddr - adr);
|
||||
ins.operands[k] = changedOperand;
|
||||
ins.operands[0] = changedOperand;
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Invalid jump target in script {0}, bodyIndex {1}", new Object[]{toString(), bodyIndex});
|
||||
}
|
||||
for (int k = 2; k < ins.operands.length; k++) {
|
||||
targetAddr = ins.getAddress() + ins.operands[k];
|
||||
if (mapOffsets.containsKey(targetAddr)) {
|
||||
changedAddr = mapOffsets.get(targetAddr);
|
||||
changedOperand = (int) (changedAddr - adr);
|
||||
ins.operands[k] = changedOperand;
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Invalid jump target in script {0}, bodyIndex {1}", new Object[]{toString(), bodyIndex});
|
||||
}
|
||||
}
|
||||
}
|
||||
ins.setAddress(adr);
|
||||
|
||||
Reference in New Issue
Block a user