mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-03 12:14:24 +00:00
AS3 parser stub improved
This commit is contained in:
@@ -200,8 +200,8 @@ import com.jpexs.decompiler.flash.abc.avm2.model.SetPropertyAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.SetSlotAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.clauses.DeclarationAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser;
|
||||
import com.jpexs.decompiler.flash.abc.types.ABCException;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
|
||||
@@ -250,7 +250,7 @@ public class AVM2Code implements Serializable {
|
||||
public static final long serialVersionUID = 1L;
|
||||
private static final boolean DEBUG_MODE = false;
|
||||
public static int toSourceLimit = -1;
|
||||
public ArrayList<AVM2Instruction> code = new ArrayList<>();
|
||||
public List<AVM2Instruction> code = new ArrayList<>();
|
||||
public static boolean DEBUG_REWRITE = false;
|
||||
public static final int OPT_U30 = 0x100;
|
||||
public static final int OPT_U8 = 0x200;
|
||||
@@ -829,7 +829,9 @@ public class AVM2Code implements Serializable {
|
||||
}
|
||||
|
||||
public void compact() {
|
||||
code.trimToSize();
|
||||
if (code instanceof ArrayList) {
|
||||
((ArrayList) code).trimToSize();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] getBytes() {
|
||||
@@ -1582,7 +1584,7 @@ public class AVM2Code implements Serializable {
|
||||
value = ((InitPropertyAVM2Item) ti).value;
|
||||
}
|
||||
if (ti instanceof SetPropertyAVM2Item) {
|
||||
multinameIndex = ((FullMultinameAVM2Item)((SetPropertyAVM2Item) ti).propertyName).multinameIndex;
|
||||
multinameIndex = ((FullMultinameAVM2Item) ((SetPropertyAVM2Item) ti).propertyName).multinameIndex;
|
||||
value = ((SetPropertyAVM2Item) ti).value;
|
||||
}
|
||||
for (Trait t : initTraits.traits) {
|
||||
@@ -1640,10 +1642,10 @@ public class AVM2Code implements Serializable {
|
||||
Slot sl = new Slot(ssti.scope, ssti.slotName);
|
||||
if (!declaredSlots.contains(sl)) {
|
||||
String type = "*";
|
||||
for (int t = 0; t < body.traits.traits.length; t++) {
|
||||
if (body.traits.traits[t].getName(abc) == sl.multiname) {
|
||||
if (body.traits.traits[t] instanceof TraitSlotConst) {
|
||||
type = ((TraitSlotConst) body.traits.traits[t]).getType(constants, fullyQualifiedNames);
|
||||
for (int t = 0; t < body.traits.traits.size(); t++) {
|
||||
if (body.traits.traits.get(t).getName(abc) == sl.multiname) {
|
||||
if (body.traits.traits.get(t) instanceof TraitSlotConst) {
|
||||
type = ((TraitSlotConst) body.traits.traits.get(t)).getType(constants, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user