8000332: SA ClassDump throws exception after permgen removal
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
This commit is contained in:
parent
80d5f4b66d
commit
b2cf8c4cb0
@ -354,15 +354,14 @@ public class ClassWriter implements /* imports */ ClassConstants
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#else
|
||||
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include <dlfcn.h>
|
||||
#include <link.h>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user