Update for "Fix for KT-15868: NPE when comparing nullable doubles"

This commit is contained in:
Mikhael Bogdanov
2017-02-02 09:47:22 +01:00
parent 529b526763
commit 87529f957d
@@ -3670,13 +3670,13 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
private void generate754EqualsForNullableTypes(
InstructionAdapter v,
@NotNull InstructionAdapter v,
@NotNull IElementType opToken,
@Nullable StackValue pregeneratedLeft,
@Nullable KtExpression left,
TypeAndNullability left754Type,
@NotNull TypeAndNullability left754Type,
@Nullable KtExpression right,
TypeAndNullability right754Type
@NotNull TypeAndNullability right754Type
) {
int equals = opToken == KtTokens.EQEQ ? 1 : 0;
int notEquals = opToken != KtTokens.EQEQ ? 1 : 0;
@@ -3702,7 +3702,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
v.ifnonnull(rightIsNotNull);
AsmUtil.pop(v, rightValue.type);
AsmUtil.pop(v, nonNullLeftValue.type);
v.aconst(notEquals);
v.iconst(notEquals);
v.goTo(end);
v.mark(rightIsNotNull);
}
@@ -3721,15 +3721,15 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
if (right754Type.isNullable) {
Label rightIsNotNull = new Label();
v.ifnonnull(rightIsNotNull);
v.aconst(equals);
v.iconst(equals);
v.goTo(end);
v.mark(rightIsNotNull);
v.aconst(notEquals);
v.iconst(notEquals);
//v.goTo(end);
}
else {
AsmUtil.pop(v, rightValue.type);
v.aconst(notEquals);
v.iconst(notEquals);
//v.goTo(end);
}
@@ -3751,7 +3751,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
v.ifnonnull(rightIsNotNull);
AsmUtil.pop(v, rightValue.type);
AsmUtil.pop(v, leftValue.type);
v.aconst(notEquals);
v.iconst(notEquals);
v.goTo(end);
v.mark(rightIsNotNull);