Fix VerifyError for 'when' of type 'Unit?'

This commit is contained in:
Alexander Udalov
2013-12-10 21:07:05 +04:00
parent 0d9c126485
commit 00da5fe1fb
4 changed files with 39 additions and 5 deletions
@@ -234,8 +234,10 @@ public abstract class StackValue {
}
}
else if (toType.equals(JET_UNIT_TYPE)) {
pop(v, fromType);
putUnitInstance(v);
if (!fromType.equals(getType(Void.class))) {
pop(v, fromType);
putUnitInstance(v);
}
}
else if (toType.getSort() == Type.ARRAY) {
v.checkcast(toType);
@@ -431,9 +433,7 @@ public abstract class StackValue {
v.aconst(value);
}
if (value != null) {
coerceTo(type, v);
}
coerceTo(type, v);
}
@Override