mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-22 17:25:33 +00:00
Fixed #1986 AS2 Class detection - NullPointerException on certain classes
This commit is contained in:
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
|
||||
- AS3 Metadata single value (null item key)
|
||||
- [#1981] AS3 star import collisions
|
||||
- [#1982] Slow calculation of large shape outlines - now use only rectangles for large shapes
|
||||
- [#1986] AS2 Class detection - NullPointerException on certain classes
|
||||
|
||||
### Changed
|
||||
- AS1/2/3 P-code - format Number values with EcmaScript toString function
|
||||
@@ -2985,6 +2986,7 @@ All notable changes to this project will be documented in this file.
|
||||
[alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7
|
||||
[#1981]: https://www.free-decompiler.com/flash/issues/1981
|
||||
[#1982]: https://www.free-decompiler.com/flash/issues/1982
|
||||
[#1986]: https://www.free-decompiler.com/flash/issues/1986
|
||||
[#1970]: https://www.free-decompiler.com/flash/issues/1970
|
||||
[#1972]: https://www.free-decompiler.com/flash/issues/1972
|
||||
[#1973]: https://www.free-decompiler.com/flash/issues/1973
|
||||
|
||||
@@ -279,7 +279,7 @@ public class ActionScript2ClassDetector {
|
||||
}
|
||||
|
||||
private boolean checkClassContent(List<GraphTargetItem> parts, HashMap<String, GraphTargetItem> variables, int partsPos, int commandsStartPos, int commandsEndPos, List<GraphTargetItem> commands, List<String> classNamePath, String scriptPath) {
|
||||
|
||||
|
||||
try {
|
||||
|
||||
GraphTargetItem extendsOp = null;
|
||||
@@ -299,7 +299,7 @@ public class ActionScript2ClassDetector {
|
||||
StoreRegisterActionItem sr = (StoreRegisterActionItem) item;
|
||||
definedRegisters.add(sr.register.number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parts.size() > partsPos) {
|
||||
item = parts.get(partsPos);
|
||||
@@ -341,16 +341,18 @@ public class ActionScript2ClassDetector {
|
||||
List<String> protoPath = new ArrayList<>(classNamePath);
|
||||
protoPath.add("prototype");
|
||||
List<String> smPath = getSetMembersPath(sm);
|
||||
if (smPath.get(0).equals("_global")) {
|
||||
smPath.remove(0);
|
||||
}
|
||||
if (smPath.equals(protoPath)) {
|
||||
if (sm.value instanceof StoreRegisterActionItem) {
|
||||
partsPos++;
|
||||
if (parts.size() > partsPos) {
|
||||
item = parts.get(partsPos);
|
||||
} else {
|
||||
item = null;
|
||||
if (smPath != null) { //null = can start with TempRegister for example
|
||||
if (smPath.get(0).equals("_global")) {
|
||||
smPath.remove(0);
|
||||
}
|
||||
if (smPath.equals(protoPath)) {
|
||||
if (sm.value instanceof StoreRegisterActionItem) {
|
||||
partsPos++;
|
||||
if (parts.size() > partsPos) {
|
||||
item = parts.get(partsPos);
|
||||
} else {
|
||||
item = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,7 +697,7 @@ public class ActionScript2ClassDetector {
|
||||
} else if (item instanceof DirectValueActionItem) {
|
||||
//ignore such values
|
||||
//TODO: maybe somehow display in the class ?
|
||||
} else if (item instanceof ScriptEndItem){
|
||||
} else if (item instanceof ScriptEndItem) {
|
||||
//ignore
|
||||
} else {
|
||||
throw new AssertException("unknown item - " + item.getClass().getSimpleName());
|
||||
@@ -819,7 +821,7 @@ public class ActionScript2ClassDetector {
|
||||
return true;
|
||||
} else {
|
||||
break check_variant1;
|
||||
}
|
||||
}
|
||||
} else if (this.checkClassContent(ifItem.onTrue, variables, 0, pos, checkPos, commands, classPath, scriptPath)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user