Internal viewer - AS1/2 execution - jump fix

This commit is contained in:
Jindra Petřík
2015-12-29 12:03:56 +01:00
parent 2429ce9bb8
commit b1c20f48b9

View File

@@ -861,17 +861,23 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
return Undefined.INSTANCE;
}
long ip = sis.getPos();
//System.err.println("=============");
Action a;
while ((a = sis.readAction()) != null) {
int actionLengthWithHeader = a.getTotalActionLength();
a.setAddress(sis.getPos());
a.setAddress(ip);
a.execute(lda);
/*System.err.print("" + a + ", stack: [");
for (Object o : lda.stack) {
System.err.print("" + o + ",");
}
System.err.println("]");*/
if (lda.returnValue != null) {
return lda.returnValue;
}
if (lda.jump != null) {
ip = lda.jump;
lda.jump = null;
} else {
ip += actionLengthWithHeader;
}