Fix StackValue.coerce void to Object
We can only put Unit.VALUE on stack if we're requested an instance of Object or Unit. In other cases (arbitrary objects / arrays) we put null instead
This commit is contained in:
@@ -230,9 +230,12 @@ public abstract class StackValue {
|
||||
pop(fromType, v);
|
||||
}
|
||||
else if (fromType.getSort() == Type.VOID) {
|
||||
if (toType.getSort() == Type.OBJECT) {
|
||||
if (toType.equals(JET_UNIT_TYPE) || toType.equals(OBJECT_TYPE)) {
|
||||
putUnitInstance(v);
|
||||
}
|
||||
else if (toType.getSort() == Type.OBJECT || toType.getSort() == Type.ARRAY) {
|
||||
v.aconst(null);
|
||||
}
|
||||
else {
|
||||
pushDefaultPrimitiveValueOnStack(toType, v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user