[Ikvm-commit] ikvm/ikvmc CompilerClassLoader.cs,1.268,1.269
Brought to you by:
jfrijters
|
From: Jeroen F. <jfr...@us...> - 2014-06-24 09:44:39
|
Update of /cvsroot/ikvm/ikvm/ikvmc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv546/ikvmc Modified Files: CompilerClassLoader.cs Log Message: Bug fix. Only the bootstrap class loader is allowed to define classes in the java package. Index: CompilerClassLoader.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/CompilerClassLoader.cs,v retrieving revision 1.268 retrieving revision 1.269 diff -C2 -d -r1.268 -r1.269 *** CompilerClassLoader.cs 13 Jun 2014 06:54:06 -0000 1.268 --- CompilerClassLoader.cs 24 Jun 2014 09:44:37 -0000 1.269 *************** *** 72,77 **** private List<string> jarList = new List<string>(); private List<TypeWrapper> allwrappers; ! internal CompilerClassLoader(AssemblyClassLoader[] referencedAssemblies, CompilerOptions options, FileInfo assemblyPath, bool targetIsModule, string assemblyName, Dictionary<string, Jar.Item> classes) : base(options.codegenoptions, null) { --- 72,78 ---- private List<string> jarList = new List<string>(); private List<TypeWrapper> allwrappers; + private bool compilingCoreAssembly; ! internal CompilerClassLoader(AssemblyClassLoader[] referencedAssemblies, CompilerOptions options, FileInfo assemblyPath, bool targetIsModule, string assemblyName, Dictionary<string, Jar.Item> classes, bool compilingCoreAssembly) : base(options.codegenoptions, null) { *************** *** 83,86 **** --- 84,88 ---- this.assemblyDir = assemblyPath.DirectoryName; this.targetIsModule = targetIsModule; + this.compilingCoreAssembly = compilingCoreAssembly; Tracer.Info(Tracer.Compiler, "Instantiate CompilerClassLoader for {0}", assemblyName); } *************** *** 2567,2571 **** if (c.Shadows != null && c.Name == "java.lang.Object") { ! return true; } } --- 2569,2573 ---- if (c.Shadows != null && c.Name == "java.lang.Object") { ! return compilingCoreAssembly = true; } } *************** *** 2871,2875 **** referencedAssemblies[i] = acl; } ! loader = new CompilerClassLoader(referencedAssemblies, options, options.path, options.targetIsModule, options.assembly, h); loader.classesToCompile = new List<string>(h.Keys); if(options.remapfile != null) --- 2873,2877 ---- referencedAssemblies[i] = acl; } ! loader = new CompilerClassLoader(referencedAssemblies, options, options.path, options.targetIsModule, options.assembly, h, compilingCoreAssembly); loader.classesToCompile = new List<string>(h.Keys); if(options.remapfile != null) *************** *** 3329,3332 **** --- 3331,3342 ---- get { return options.noParameterReflection; } } + + protected override void CheckProhibitedPackage(string className) + { + if (!compilingCoreAssembly) + { + base.CheckProhibitedPackage(className); + } + } } |