From 87529f957d9fca8314ab2cf23079bf85bbf3a114 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 2 Feb 2017 09:47:22 +0100 Subject: [PATCH] Update for "Fix for KT-15868: NPE when comparing nullable doubles" --- .../kotlin/codegen/ExpressionCodegen.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 9801257d07d..22535928ec5 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -3670,13 +3670,13 @@ public class ExpressionCodegen extends KtVisitor 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 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 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 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);