OpenJDK / jdk / jdk12
changeset 24403:f2ce14657001
8035763: Error parsing binary type annotations data in javac
Summary: Fix accidental reversal of read order from a previous change
Reviewed-by: jjg
author | emc |
---|---|
date | Fri, 09 May 2014 22:27:07 -0400 |
parents | 96a0a92dc38d |
children | cf534ffbc9d8 |
files | langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java |
diffstat | 1 files changed, 24 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Fri May 09 18:50:12 2014 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Fri May 09 22:27:07 2014 -0400 @@ -1540,35 +1540,41 @@ // local variable case LOCAL_VARIABLE: { final int table_length = nextChar(); - final TypeAnnotationPosition position = - TypeAnnotationPosition.localVariable(readTypePath()); - - position.lvarOffset = new int[table_length]; - position.lvarLength = new int[table_length]; - position.lvarIndex = new int[table_length]; + final int[] newLvarOffset = new int[table_length]; + final int[] newLvarLength = new int[table_length]; + final int[] newLvarIndex = new int[table_length]; for (int i = 0; i < table_length; ++i) { - position.lvarOffset[i] = nextChar(); - position.lvarLength[i] = nextChar(); - position.lvarIndex[i] = nextChar(); + newLvarOffset[i] = nextChar(); + newLvarLength[i] = nextChar(); + newLvarIndex[i] = nextChar(); } + + final TypeAnnotationPosition position = + TypeAnnotationPosition.localVariable(readTypePath()); + position.lvarOffset = newLvarOffset; + position.lvarLength = newLvarLength; + position.lvarIndex = newLvarIndex; return position; } // resource variable case RESOURCE_VARIABLE: { final int table_length = nextChar(); - final TypeAnnotationPosition position = - TypeAnnotationPosition.resourceVariable(readTypePath()); - - position.lvarOffset = new int[table_length]; - position.lvarLength = new int[table_length]; - position.lvarIndex = new int[table_length]; + final int[] newLvarOffset = new int[table_length]; + final int[] newLvarLength = new int[table_length]; + final int[] newLvarIndex = new int[table_length]; for (int i = 0; i < table_length; ++i) { - position.lvarOffset[i] = nextChar(); - position.lvarLength[i] = nextChar(); - position.lvarIndex[i] = nextChar(); + newLvarOffset[i] = nextChar(); + newLvarLength[i] = nextChar(); + newLvarIndex[i] = nextChar(); } + + final TypeAnnotationPosition position = + TypeAnnotationPosition.resourceVariable(readTypePath()); + position.lvarOffset = newLvarOffset; + position.lvarLength = newLvarLength; + position.lvarIndex = newLvarIndex; return position; } // exception parameter