Fixed #1888 AS3 - missing casts in declarations

This commit is contained in:
Jindra Petřík
2023-01-11 17:49:14 +01:00
parent a2bdabae5d
commit fbd0d9f5cb
2 changed files with 4 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ public class DeclarationAVM2Item extends AVM2Item {
coerType = ((ConvertAVM2Item) ssti.value).type;
}
//strip coerce if its declared as this type
if (coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) {
if ((ssti.value instanceof CoerceAVM2Item) && coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) {
val = val.value;
}
@@ -167,7 +167,7 @@ public class DeclarationAVM2Item extends AVM2Item {
coerType = ((ConvertAVM2Item) spti.value).type;
}
//strip coerce if its declared as this type
if (coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) {
if ((spti.value instanceof CoerceAVM2Item) && coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) {
val = val.value;
}