diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java index 97bacc4d0..d5dbc4b5b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java @@ -52,8 +52,8 @@ public class SwapIns extends InstructionDefinition { GraphTargetItem o2 = stack.pop(); stack.push(o1); stack.push(o2); - o1.moreSrc.add(new GraphSourceItemPos(ins, 0)); - o2.moreSrc.add(new GraphSourceItemPos(ins, 0)); + o1.getMoreSrc().add(new GraphSourceItemPos(ins, 0)); + o2.getMoreSrc().add(new GraphSourceItemPos(ins, 0)); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java index f00e5bc70..81c19a86e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -39,6 +39,6 @@ public class ActionPushDuplicate extends Action { public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.peek(); stack.push(new DuplicateItem(this, value)); - value.moreSrc.add(new GraphSourceItemPos(this, 0)); + value.getMoreSrc().add(new GraphSourceItemPos(this, 0)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java index ebbcd11c8..7805d3583 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf5; import com.jpexs.decompiler.flash.action.Action; @@ -39,7 +40,7 @@ public class ActionStackSwap extends Action { GraphTargetItem b = stack.pop(); stack.push(a); stack.push(b); - a.moreSrc.add(new GraphSourceItemPos(this, 0)); - b.moreSrc.add(new GraphSourceItemPos(this, 0)); + a.getMoreSrc().add(new GraphSourceItemPos(this, 0)); + b.getMoreSrc().add(new GraphSourceItemPos(this, 0)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java index b13104d74..4100767a4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf5; import com.jpexs.decompiler.flash.SWFInputStream; @@ -82,7 +83,7 @@ public class ActionStoreRegister extends Action implements StoreTypeAction { if (regNames.containsKey(registerNumber)) { rn.name = regNames.get(registerNumber); } - value.moreSrc.add(new GraphSourceItemPos(this, 0)); + value.getMoreSrc().add(new GraphSourceItemPos(this, 0)); if (variables.containsKey("__register" + registerNumber)) { if (variables.get("__register" + registerNumber) instanceof TemporaryRegister) { variables.remove("__register" + registerNumber); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java index d4af4ec42..006643b7c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -76,7 +76,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { protected int precedence; - public List moreSrc = new ArrayList<>(); + private List moreSrc; public GraphPart firstPart; @@ -122,6 +122,14 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { return src; } + public List getMoreSrc() { + if (moreSrc == null) { + moreSrc = new ArrayList<>() + } + + return moreSrc; + } + protected HighlightData getSrcData() { if (srcData == null) { srcData = new HighlightData(); @@ -133,10 +141,14 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { public List getNeededSources() { List ret = new ArrayList<>(); ret.add(new GraphSourceItemPos(src, pos)); - ret.addAll(moreSrc); + if (moreSrc != null) { + ret.addAll(moreSrc); + } + if (value != null) { ret.addAll(value.getNeededSources()); } + return ret; }