view patches/boot/ecj-autoboxing.patch @ 2726:0eb67382af67

Bring in 2014/04/15 security fixes. 2014-03-28 Andrew John Hughes <gnu.andrew@redhat.com> * Makefile.am: (CORBA_CHANGESET): Update to icedtea-2.4.7 tag. (JAXP_CHANGESET): Likewise. (JAXWS_CHANGESET): Likewise. (JDK_CHANGESET): Likewise. (LANGTOOLS_CHANGESET): Likewise. (OPENJDK_CHANGESET): Likewise. (CORBA_SHA256SUM): Likewise. (JAXP_SHA256SUM): Likewise. (JAXWS_SHA256SUM): Likewise. (JDK_SHA256SUM): Likewise. (LANGTOOLS_SHA256SUM): Likewise. (OPENJDK_SHA256SUM): Likewise. (ICEDTEA_PATCHES): Add HotSpot security fixes for AArch64 port. (ICEDTEA_ENV): Set FULL_DEBUG_SYMBOLS=0 in AArch64 build to avoid generating .diz files. * NEWS: Updated. * hotspot.map: default updated to icedtea-2.4.7 tag. * patches/boot/ecj-autoboxing.patch: Regenerated. * patches/boot/ecj-diamond.patch: Regenerated and new cases added. * patches/boot/ecj-trywithresources.patch: Regenerated. * patches/hotspot/aarch64/20140415-8029858-enhance_array_copies.patch, * patches/hotspot/aarch64/20140415-8034926-attribute_classes_properly.patch: HotSpot security fixes for AArch64 port.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Wed, 16 Apr 2014 03:18:47 +0100
parents ff15cee90ed8
children
line wrap: on
line source

diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java	2014-04-11 13:53:55.090502246 +0100
+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java	2014-04-11 13:56:18.568583499 +0100
@@ -71,11 +71,11 @@
             case 'I':
                 return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('I').constructor[0].invokeBasic(type, form, ValueConversions.widenSubword(x));
             case 'J':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('J').constructor[0].invokeBasic(type, form, (long) x);
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('J').constructor[0].invokeBasic(type, form, (Long) x);
             case 'F':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('F').constructor[0].invokeBasic(type, form, (float) x);
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('F').constructor[0].invokeBasic(type, form, (Float) x);
             case 'D':
-                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('D').constructor[0].invokeBasic(type, form, (double) x);
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('D').constructor[0].invokeBasic(type, form, (Double) x);
             default : throw new InternalError("unexpected xtype: " + xtype);
             }
         } catch (Throwable t) {
@@ -92,9 +92,9 @@
             switch (xtype) {
             case 'L': return cloneExtendL(type, form, x);
             case 'I': return cloneExtendI(type, form, ValueConversions.widenSubword(x));
-            case 'J': return cloneExtendJ(type, form, (long) x);
-            case 'F': return cloneExtendF(type, form, (float) x);
-            case 'D': return cloneExtendD(type, form, (double) x);
+            case 'J': return cloneExtendJ(type, form, (Long) x);
+            case 'F': return cloneExtendF(type, form, (Float) x);
+            case 'D': return cloneExtendD(type, form, (Double) x);
             }
         } catch (Throwable t) {
             throw newInternalError(t);
@@ -171,10 +171,10 @@
         throw new InternalError("unexpected type: " + speciesData().types+"."+i);
     }
     /*non-public*/ final Object argL(int i) throws Throwable { return          speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final int    argI(int i) throws Throwable { return (int)    speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final float  argF(int i) throws Throwable { return (float)  speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final double argD(int i) throws Throwable { return (double) speciesData().getters[i].invokeBasic(this); }
-    /*non-public*/ final long   argJ(int i) throws Throwable { return (long)   speciesData().getters[i].invokeBasic(this); }
+    /*non-public*/ final int    argI(int i) throws Throwable { return (Integer)    speciesData().getters[i].invokeBasic(this); }
+    /*non-public*/ final float  argF(int i) throws Throwable { return (Float)  speciesData().getters[i].invokeBasic(this); }
+    /*non-public*/ final double argD(int i) throws Throwable { return (Double) speciesData().getters[i].invokeBasic(this); }
+    /*non-public*/ final long   argJ(int i) throws Throwable { return (Long)   speciesData().getters[i].invokeBasic(this); }
 
     //
     // cloning API
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/CallSite.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/CallSite.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/CallSite.java	2013-10-09 22:54:00.613935571 +0100
+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/CallSite.java	2014-04-11 13:55:24.783804675 +0100
@@ -303,7 +303,7 @@
 
     private static Object maybeReBox(Object x) {
         if (x instanceof Integer) {
-            int xi = (int) x;
+            int xi = (Integer) x;
             if (xi == (byte) xi)
                 x = xi;  // must rebox; see JLS 5.1.7
         }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	2014-04-04 16:36:14.375922473 +0100
+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	2014-04-11 13:55:24.799804908 +0100
@@ -315,11 +315,11 @@
             return;
         }
         if (con instanceof Integer) {
-            emitIconstInsn((int) con);
+            emitIconstInsn((Integer) con);
             return;
         }
         if (con instanceof Long) {
-            long x = (long) con;
+            long x = (Long) con;
             if (x == (short) x) {
                 emitIconstInsn((int) x);
                 mv.visitInsn(Opcodes.I2L);
@@ -327,7 +327,7 @@
             }
         }
         if (con instanceof Float) {
-            float x = (float) con;
+            float x = (Float) con;
             if (x == (short) x) {
                 emitIconstInsn((int) x);
                 mv.visitInsn(Opcodes.I2F);
@@ -335,7 +335,7 @@
             }
         }
         if (con instanceof Double) {
-            double x = (double) con;
+            double x = (Double) con;
             if (x == (short) x) {
                 emitIconstInsn((int) x);
                 mv.visitInsn(Opcodes.I2D);
@@ -343,7 +343,7 @@
             }
         }
         if (con instanceof Boolean) {
-            emitIconstInsn((boolean) con ? 1 : 0);
+            emitIconstInsn((Boolean) con ? 1 : 0);
             return;
         }
         // fall through:
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/LambdaForm.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/LambdaForm.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/LambdaForm.java	2014-04-11 13:53:55.090502246 +0100
+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/LambdaForm.java	2014-04-11 13:55:24.803804965 +0100
@@ -1444,7 +1444,7 @@
                         if (a1 instanceof Integer && a2 instanceof Integer) {
                             if (sawInt)  continue;
                             sawInt = true;
-                            if ((int)a1 < (int)a2)  continue;  // still might be true
+                            if (((Integer)a1).intValue() < ((Integer)a2).intValue())  continue;  // still might be true
                         }
                         return false;
                     }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java	2014-04-11 13:53:55.122502710 +0100
+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java	2014-04-11 13:55:24.807805024 +0100
@@ -884,7 +884,7 @@
                 MH_checkCallerClass = IMPL_LOOKUP
                     .findStatic(THIS_CLASS, "checkCallerClass",
                                 MethodType.methodType(boolean.class, Class.class, Class.class));
-                assert((boolean) MH_checkCallerClass.invokeExact(THIS_CLASS, THIS_CLASS));
+                assert((Boolean) MH_checkCallerClass.invokeExact(THIS_CLASS, THIS_CLASS));
             } catch (Throwable ex) {
                 throw newInternalError(ex);
             }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java
--- openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java	2014-04-11 13:53:55.094502303 +0100
+++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java	2014-04-11 13:55:24.787804734 +0100
@@ -191,9 +191,9 @@
         if (x instanceof Number) {
             res = (Number) x;
         } else if (x instanceof Boolean) {
-            res = ((boolean)x ? ONE_INT : ZERO_INT);
+            res = ((Boolean)x ? ONE_INT : ZERO_INT);
         } else if (x instanceof Character) {
-            res = (int)(char)x;
+            res = (int)(Character)x;
         } else {
             // this will fail with the required ClassCastException:
             res = (Number) x;
@@ -212,52 +212,52 @@
      */
     public static int widenSubword(Object x) {
         if (x instanceof Integer)
-            return (int) x;
+            return (Integer) x;
         else if (x instanceof Boolean)
-            return fromBoolean((boolean) x);
+            return fromBoolean((Boolean) x);
         else if (x instanceof Character)
-            return (char) x;
+            return (Character) x;
         else if (x instanceof Short)
-            return (short) x;
+            return (Short) x;
         else if (x instanceof Byte)
-            return (byte) x;
+            return (Byte) x;
         else
             // Fail with a ClassCastException.
-            return (int) x;
+            return (Integer) x;
     }
 
     /// Converting primitives to references
 
     static Integer boxInteger(int x) {
-        return x;
+      return Integer.valueOf(x);
     }
 
     static Byte boxByte(byte x) {
-        return x;
+      return Byte.valueOf(x);
     }
 
     static Short boxShort(short x) {
-        return x;
+      return Short.valueOf(x);
     }
 
     static Boolean boxBoolean(boolean x) {
-        return x;
+      return Boolean.valueOf(x);
     }
 
     static Character boxCharacter(char x) {
-        return x;
+      return Character.valueOf(x);
     }
 
     static Long boxLong(long x) {
-        return x;
+      return Long.valueOf(x);
     }
 
     static Float boxFloat(float x) {
-        return x;
+      return Float.valueOf(x);
     }
 
     static Double boxDouble(double x) {
-        return x;
+      return Double.valueOf(x);
     }
 
     private static MethodType boxType(Wrapper wrap) {