Update for "Fix for KT-15868: NPE when comparing nullable doubles"
This commit is contained in:
@@ -3670,13 +3670,13 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void generate754EqualsForNullableTypes(
|
private void generate754EqualsForNullableTypes(
|
||||||
InstructionAdapter v,
|
@NotNull InstructionAdapter v,
|
||||||
@NotNull IElementType opToken,
|
@NotNull IElementType opToken,
|
||||||
@Nullable StackValue pregeneratedLeft,
|
@Nullable StackValue pregeneratedLeft,
|
||||||
@Nullable KtExpression left,
|
@Nullable KtExpression left,
|
||||||
TypeAndNullability left754Type,
|
@NotNull TypeAndNullability left754Type,
|
||||||
@Nullable KtExpression right,
|
@Nullable KtExpression right,
|
||||||
TypeAndNullability right754Type
|
@NotNull TypeAndNullability right754Type
|
||||||
) {
|
) {
|
||||||
int equals = opToken == KtTokens.EQEQ ? 1 : 0;
|
int equals = opToken == KtTokens.EQEQ ? 1 : 0;
|
||||||
int notEquals = 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);
|
v.ifnonnull(rightIsNotNull);
|
||||||
AsmUtil.pop(v, rightValue.type);
|
AsmUtil.pop(v, rightValue.type);
|
||||||
AsmUtil.pop(v, nonNullLeftValue.type);
|
AsmUtil.pop(v, nonNullLeftValue.type);
|
||||||
v.aconst(notEquals);
|
v.iconst(notEquals);
|
||||||
v.goTo(end);
|
v.goTo(end);
|
||||||
v.mark(rightIsNotNull);
|
v.mark(rightIsNotNull);
|
||||||
}
|
}
|
||||||
@@ -3721,15 +3721,15 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
if (right754Type.isNullable) {
|
if (right754Type.isNullable) {
|
||||||
Label rightIsNotNull = new Label();
|
Label rightIsNotNull = new Label();
|
||||||
v.ifnonnull(rightIsNotNull);
|
v.ifnonnull(rightIsNotNull);
|
||||||
v.aconst(equals);
|
v.iconst(equals);
|
||||||
v.goTo(end);
|
v.goTo(end);
|
||||||
v.mark(rightIsNotNull);
|
v.mark(rightIsNotNull);
|
||||||
v.aconst(notEquals);
|
v.iconst(notEquals);
|
||||||
//v.goTo(end);
|
//v.goTo(end);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AsmUtil.pop(v, rightValue.type);
|
AsmUtil.pop(v, rightValue.type);
|
||||||
v.aconst(notEquals);
|
v.iconst(notEquals);
|
||||||
//v.goTo(end);
|
//v.goTo(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3751,7 +3751,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
v.ifnonnull(rightIsNotNull);
|
v.ifnonnull(rightIsNotNull);
|
||||||
AsmUtil.pop(v, rightValue.type);
|
AsmUtil.pop(v, rightValue.type);
|
||||||
AsmUtil.pop(v, leftValue.type);
|
AsmUtil.pop(v, leftValue.type);
|
||||||
v.aconst(notEquals);
|
v.iconst(notEquals);
|
||||||
v.goTo(end);
|
v.goTo(end);
|
||||||
|
|
||||||
v.mark(rightIsNotNull);
|
v.mark(rightIsNotNull);
|
||||||
|
|||||||
Reference in New Issue
Block a user