# HG changeset patch # User minqi # Date 1349740132 25200 # Node ID bcadb91512038e368ea68bb655b85c7c65c370ec # Parent a96fb2fe0c0814a49bb19e0410bccd55bcb9d6aa 8000332: SA ClassDump throws exception after permgen removal Summary: In ClassWrite.writeFields(), fields count was mistakenly set to fields length which overflow the array index. Also removed a file which is leftover from 6879063 changeset. Reviewed-by: coleenp, sspitsyn Contributed-by: yumin.qi@oracle.com diff -r a96fb2fe0c08 -r bcadb9151203 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java Sun Sep 30 23:24:12 2012 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java Mon Oct 08 16:48:52 2012 -0700 @@ -354,15 +354,14 @@ } protected void writeFields() throws IOException { - U2Array fields = klass.getFields(); - final int length = (int) fields.length(); + final int javaFieldsCount = klass.getJavaFieldsCount(); // write number of fields - dos.writeShort((short) length); + dos.writeShort((short) javaFieldsCount); - if (DEBUG) debugMessage("number of fields = " + length); + if (DEBUG) debugMessage("number of fields = " + javaFieldsCount); - for (int index = 0; index < length; index++) { + for (int index = 0; index < javaFieldsCount; index++) { short accessFlags = klass.getFieldAccessFlags(index); dos.writeShort(accessFlags & (short) JVM_RECOGNIZED_FIELD_MODIFIERS); diff -r a96fb2fe0c08 -r bcadb9151203 hotspot/agent/src/share/native/sadis.c --- a/hotspot/agent/src/share/native/sadis.c Sun Sep 30 23:24:12 2012 +0100 +++ b/hotspot/agent/src/share/native/sadis.c Mon Oct 08 16:48:52 2012 -0700 @@ -46,7 +46,7 @@ #else -#include +#include #include #include