diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index a4409a7c3..3df1f12cf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -1499,7 +1499,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if ((round == 1) && (m.matches())) { String regIndexStr = m.group(1); int regIndex = Integer.parseInt(regIndexStr); - while (registerNames.size() <= regIndex) { + while (registerNames.size() <= regIndex + 1) { String standardName = String.format(mask, registerNames.size() - 1); registerNames.add(standardName); registerTypes.add("*"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java index c7c9b09c7..550c7ec24 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java @@ -2181,7 +2181,7 @@ public class ActionScriptParser { break; case INCREMENT: case DECREMENT: //preincrement - GraphTargetItem varincdec = expression(thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, false/*?*/, variables);//name(thisType,false, openedNamespaces, registerVars, inFunction, inMethod, variables); + GraphTargetItem varincdec = expressionPrimary(thisType, pkg, needsActivation, importedClasses, openedNamespaces, false, registerVars, inFunction, inMethod, false/*?*/, variables);//name(thisType,false, openedNamespaces, registerVars, inFunction, inMethod, variables); if (!isNameOrProp(varincdec)) { throw new AVM2ParseException("Not a property or name", lexer.yyline()); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java index 0279c2ad5..e831f7df8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java @@ -343,11 +343,12 @@ public class NameAVM2Item extends AssignableAVM2Item { //Start get original generateGetLoc(regNumber), generateGetSlot(slotScope, slotNumber), //End get original - !isInteger ? ins(new ConvertDIns()) : null, + //!isInteger ? ins(new ConvertDIns()) : null, //End get original (!post) ? (decrement ? ins(isInteger ? new DecrementIIns() : new DecrementIns()) : ins(isInteger ? new IncrementIIns() : new IncrementIns())) : null, needsReturn ? ins(new DupIns()) : null, (post) ? (decrement ? ins(isInteger ? new DecrementIIns() : new DecrementIns()) : ins(isInteger ? new IncrementIIns() : new IncrementIns())) : null, + generateCoerce(localData, generator, returnType()), generateSetLoc(regNumber), slotNumber > -1 ? ins(new SetSlotIns(), slotNumber) : null ); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 9790969f5..4c4f868f7 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -450,7 +450,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL if (ch != null) { Highlighting th = Highlighting.searchPos(traitHighlights, pos); if (th != null) { - currentTrait = abc.findTraitByTraitId((int) ch.getProperties().index, (int) th.getProperties().index); + currentTrait = abc.findTraitByTraitId((int) ch.getProperties().index, (int) th.getProperties().index); } }