mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-05 16:45:16 +00:00
AS3 preincrement fix
use same local register names fix
This commit is contained in:
@@ -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("*");
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user