Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jvm/jvm.build4
-rw-r--r--runtime/ClassLoaderWrapper.cs27
2 files changed, 21 insertions, 10 deletions
diff --git a/jvm/jvm.build b/jvm/jvm.build
index 7e5b743a..dd76d9b7 100644
--- a/jvm/jvm.build
+++ b/jvm/jvm.build
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<project name="JVM" default="JVM">
<target name="JVM">
- <exec program="../tools/asmref" useruntimeengine="true" commandline="mscorlib" output="jvm_h1.il" />
- <exec program="../tools/asmref" useruntimeengine="true" commandline="../bin/IKVM.Runtime.dll" output="jvm_h2.il" />
+ <exec program="../tools/asmref.exe" useruntimeengine="true" commandline="mscorlib" output="jvm_h1.il" />
+ <exec program="../tools/asmref.exe" useruntimeengine="true" commandline="../bin/IKVM.Runtime.dll" output="jvm_h2.il" />
<exec program="ilasm" commandline="/dll /out:../bin/JVM.DLL jvm_h1.il jvm_h2.il JVM.il" />
</target>
</project>
diff --git a/runtime/ClassLoaderWrapper.cs b/runtime/ClassLoaderWrapper.cs
index 680923b1..f9bb0b45 100644
--- a/runtime/ClassLoaderWrapper.cs
+++ b/runtime/ClassLoaderWrapper.cs
@@ -238,17 +238,28 @@ class ClassLoaderWrapper
{
dims++;
}
- switch(name[dims])
+ if(name[dims] == 'L')
{
- case 'L':
+ if(!name.EndsWith(";") || name.Length <= dims + 2 || name[dims + 1] == '[')
{
- type = LoadClassByDottedNameFast(name.Substring(dims + 1, name.IndexOf(';', dims) - dims - 1));
- if(type != null)
- {
- type = type.GetClassLoader().CreateArrayType(name, type.TypeAsArrayType, dims);
- }
- return type;
+ // malformed class name
+ return null;
}
+ string elemClass = name.Substring(dims + 1, name.Length - dims - 2);
+ type = LoadClassByDottedNameFast(elemClass);
+ if(type != null)
+ {
+ type = type.GetClassLoader().CreateArrayType(name, type.TypeAsArrayType, dims);
+ }
+ return type;
+ }
+ if(name.Length != dims + 1)
+ {
+ // malformed class name
+ return null;
+ }
+ switch(name[dims])
+ {
case 'B':
return GetBootstrapClassLoader().CreateArrayType(name, PrimitiveTypeWrapper.BYTE.TypeAsArrayType, dims);
case 'C':