Issue #1283 AS3 Unbounded Vector - Vector<*> decompilation and direct editation fix

This commit is contained in:
Jindra Petřík
2016-10-03 23:45:33 +02:00
parent f55d8a2438
commit ca31ef513d
3 changed files with 6 additions and 1 deletions

View File

@@ -2688,7 +2688,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
int[] params = new int[atype.params.size()];
int i = 0;
for (GraphTargetItem s : atype.params) {
params[i++] = resolveType(localData, s, abcIndex);
params[i++] = (s instanceof NullAVM2Item) ? 0 : resolveType(localData, s, abcIndex);
}
return constants.getMultinameId(Multiname.createTypeName(name_index, params), true);
}

View File

@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns;
import com.jpexs.decompiler.flash.abc.avm2.model.ApplyTypeAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.InitVectorAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.abc.types.Multiname;
import com.jpexs.decompiler.flash.abc.types.Namespace;
@@ -115,6 +116,9 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
if (r == null) {
return null;
}
if (pm == 0) {
r = new NullAVM2Item(null, null);
}
params.add(r);
}
return new ApplyTypeAVM2Item(null, null, obj, params);