GraphTargetItem.src is readonly (field is private, getter added)

This commit is contained in:
2015-07-09 10:51:04 +02:00
parent 0437e95b4f
commit 42a8fc4c22
46 changed files with 167 additions and 152 deletions
@@ -756,9 +756,9 @@ public class AVM2Graph extends Graph {
SetTypeAVM2Item sti = (SetTypeAVM2Item) w.commands.remove(0);
GraphTargetItem gti = sti.getValue().getNotCoerced();
if (gti instanceof NextValueAVM2Item) {
return new ForEachInAVM2Item(w.src, w.loop, new InAVM2Item(hn.getInstruction(), sti.getObject(), ((HasNextAVM2Item) w.expression.get(w.expression.size() - 1)).collection), w.commands);
return new ForEachInAVM2Item(w.getSrc(), w.loop, new InAVM2Item(hn.getInstruction(), sti.getObject(), ((HasNextAVM2Item) w.expression.get(w.expression.size() - 1)).collection), w.commands);
} else if (gti instanceof NextNameAVM2Item) {
return new ForInAVM2Item(w.src, w.loop, new InAVM2Item(hn.getInstruction(), sti.getObject(), ((HasNextAVM2Item) w.expression.get(w.expression.size() - 1)).collection), w.commands);
return new ForInAVM2Item(w.getSrc(), w.loop, new InAVM2Item(hn.getInstruction(), sti.getObject(), ((HasNextAVM2Item) w.expression.get(w.expression.size() - 1)).collection), w.commands);
}
}
}
@@ -885,9 +885,9 @@ public class AVM2Graph extends Graph {
GraphTargetItem repl = null;
if (gti instanceof NextValueAVM2Item) {
repl = new ForEachInAVM2Item(ifi.src, new Loop(0, null, null), new InAVM2Item(null, sti.getObject(), hnt.collection), body);
repl = new ForEachInAVM2Item(ifi.getSrc(), new Loop(0, null, null), new InAVM2Item(null, sti.getObject(), hnt.collection), body);
} else if (gti instanceof NextNameAVM2Item) {
repl = new ForInAVM2Item(ifi.src, new Loop(0, null, null), new InAVM2Item(null, sti.getObject(), hnt.collection), body);
repl = new ForInAVM2Item(ifi.getSrc(), new Loop(0, null, null), new InAVM2Item(null, sti.getObject(), hnt.collection), body);
}
if (repl != null) {
list.remove(i);
@@ -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.abc.avm2.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -27,7 +28,7 @@ public class NameValuePair extends AVM2Item {
//public GraphTargetItem value;
public NameValuePair(GraphTargetItem name, GraphTargetItem value) {
super(name.src, NOPRECEDENCE);
super(name.getSrc(), NOPRECEDENCE);
this.name = name;
this.value = value;
}
@@ -40,7 +40,7 @@ public class DeclarationAVM2Item extends AVM2Item {
public GraphTargetItem type;
public DeclarationAVM2Item(GraphTargetItem assignment, GraphTargetItem type) {
super(assignment.src, assignment.getPrecedence());
super(assignment.getSrc(), assignment.getPrecedence());
this.type = type;
this.assignment = assignment;
}
@@ -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.
*/
@@ -56,7 +56,7 @@ public class EqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new NeqAVM2Item(src, leftSide, rightSide);
return new NeqAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -50,7 +50,7 @@ public class GeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new LtAVM2Item(src, leftSide, rightSide);
return new LtAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -50,7 +50,7 @@ public class GtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new LeAVM2Item(src, leftSide, rightSide);
return new LeAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -50,7 +50,7 @@ public class LeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new GtAVM2Item(src, leftSide, rightSide);
return new GtAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -50,7 +50,7 @@ public class LtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new GeAVM2Item(src, leftSide, rightSide);
return new GeAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -56,7 +56,7 @@ public class NeqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfCondit
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new EqAVM2Item(src, leftSide, rightSide);
return new EqAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -59,7 +59,7 @@ public class StrictEqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfC
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new StrictNeqAVM2Item(src, leftSide, rightSide);
return new StrictNeqAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -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.
*/
@@ -51,7 +51,7 @@ public class StrictNeqAVM2Item extends BinaryOpItem implements LogicalOpItem, If
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new StrictEqAVM2Item(src, leftSide, rightSide);
return new StrictEqAVM2Item(getSrc(), leftSide, rightSide);
}
@Override
@@ -348,12 +348,13 @@ public final class MethodBody implements Cloneable {
public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, AVM2ConstantPool constants, List<MethodInfo> method_info, ScopeStack scopeStack, boolean isStaticInitializer, List<String> fullyQualifiedNames, Traits initTraits) throws InterruptedException {
MethodBody body = clone();
body.getCode().markMappedOffsets();
body.getCode().fixJumps(path, body);
AVM2Code code = body.getCode();
code.markMappedOffsets();
code.fixJumps(path, body);
if (Configuration.autoDeobfuscate.get()) {
try {
body.getCode().removeTraps(constants, trait, method_info.get(this.method_info), body, abc, scriptIndex, classIndex, isStatic, path);
code.removeTraps(constants, trait, method_info.get(this.method_info), body, abc, scriptIndex, classIndex, isStatic, path);
} catch (InterruptedException ex) {
throw ex;
} catch (Throwable ex) {