diff options
author | jfrijters <jfrijters> | 2014-06-24 15:15:26 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2014-06-24 15:15:26 +0400 |
commit | 6e4fc8e4cea6f5ed1eef32d58c449f510bd8867e (patch) | |
tree | aa646e808f01f9618914470b7a7f36ce994d53cb | |
parent | a934063be05498e3eb3074b2f89a6e1733d11988 (diff) |
Bug fix. Since Java 1.7 class names aren't allowed to have [ and ] characters.
-rw-r--r-- | runtime/ClassFile.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/ClassFile.cs b/runtime/ClassFile.cs index 954ec682..95286a0f 100644 --- a/runtime/ClassFile.cs +++ b/runtime/ClassFile.cs @@ -1452,7 +1452,7 @@ namespace IKVM.Internal private ushort name_index; private string name; private TypeWrapper typeWrapper; - private static char[] invalidJava15Characters = { '.', ';' }; + private static char[] invalidJava15Characters = { '.', ';', '[', ']' }; internal ConstantPoolItemClass(BigEndianBinaryReader br) { @@ -1518,6 +1518,7 @@ namespace IKVM.Internal #endif { // since 1.5 the restrictions on class names have been greatly reduced + int start = 0; int end = name.Length; if(name[0] == '[') { @@ -1533,8 +1534,12 @@ namespace IKVM.Internal { end--; } + while(name[start] == '[') + { + start++; + } } - if(name.IndexOfAny(invalidJava15Characters, 0, end) >= 0) + if(name.IndexOfAny(invalidJava15Characters, start, end - start) >= 0) { goto barf; } |