changeset 14083:94d536aaf185

substitutabilityTest fixes
author dsimms
date Thu, 23 Mar 2017 10:30:38 +0100
parents 88a6e49ec676
children 6e086f285e3a
files src/java.base/share/classes/jdk/experimental/value/ValueType.java
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/jdk/experimental/value/ValueType.java	Thu Dec 15 12:23:20 2016 +0100
+++ b/src/java.base/share/classes/jdk/experimental/value/ValueType.java	Thu Mar 23 10:30:38 2017 +0100
@@ -214,10 +214,17 @@
                             C.vload(0).vgetfield(valueClass(), f.getName(), BytecodeDescriptor.unparse(f.getType()));
                             C.vload(1).vgetfield(valueClass(), f.getName(), BytecodeDescriptor.unparse(f.getType()));
                             if (f.getType().isPrimitive()) {
-                                C.ifcmp(TypeTag.I, CondKind.NE, "fail");
+                                Class<?> pt = f.getType();
+                                if (pt == Double.TYPE) {
+                                    C.ifcmp(TypeTag.D, CondKind.NE, "fail");
+                                } else if (pt == Long.TYPE) {
+                                    C.ifcmp(TypeTag.J, CondKind.NE, "fail");
+                                } else {
+                                    C.ifcmp(TypeTag.I, CondKind.NE, "fail");
+                                }
                             } else {
                                 C.invokestatic(Objects.class, "equals", "(Ljava/lang/Object;Ljava/lang/Object;)Z", false);
-                                C.const_(0).ifcmp(TypeTag.I, CondKind.NE, "fail");
+                                C.const_(0).ifcmp(TypeTag.I, CondKind.EQ, "fail");
                             }
                         }
                         C.const_(1);