diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-04-30 11:48:42 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-04-30 11:48:42 +0000 |
commit | 1f290d54001e508c65d6b1270c508b92d7af618c (patch) | |
tree | 2f9db4258066cb1e55b4b8ff10e06e4ef145ba9f /src/main/javassist/compiler/MemberCodeGen.java | |
parent | 2e9cd7421af4776599d3606873b05e234459e3c1 (diff) | |
download | javassist-1f290d54001e508c65d6b1270c508b92d7af618c.tar.gz javassist-1f290d54001e508c65d6b1270c508b92d7af618c.zip |
fixed an array-access bug.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@13 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/compiler/MemberCodeGen.java')
-rw-r--r-- | src/main/javassist/compiler/MemberCodeGen.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java index ffb76d52..437f1f80 100644 --- a/src/main/javassist/compiler/MemberCodeGen.java +++ b/src/main/javassist/compiler/MemberCodeGen.java @@ -673,20 +673,21 @@ public class MemberCodeGen extends CodeGen { int fi = addFieldrefInfo(f, finfo, type); int i = 0; + int dim = 0; char c = type.charAt(i); + while (c == '[') { + ++dim; + c = type.charAt(++i); + } + + arrayDim = dim; boolean is2byte = (c == 'J' || c == 'D'); exprType = descToType(c); - arrayDim = 0; - if (c == '[') { - i = 1; - while ((c = type.charAt(i)) == '[') - ++i; - - arrayDim = i; - } if (c == 'L') className = type.substring(i + 1, type.indexOf(';', i + 1)); + else + className = null; if (noRead) return fi; |