diff options
author | jfrijters <jfrijters> | 2011-11-29 11:03:22 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-11-29 11:03:22 +0400 |
commit | 80e43e17ab7a239559d3ac9d07a051ce6428428f (patch) | |
tree | 2acf466196495b0cb32b31125c82b16342d95061 | |
parent | fc0082cd49fe8c4d3e3329847620db3c466b780e (diff) |
Added -Xverify option to ikvm.exe.
-rw-r--r-- | ikvm/starter.cs | 6 | ||||
-rw-r--r-- | runtime/ClassLoaderWrapper.cs | 4 | ||||
-rw-r--r-- | runtime/vm.cs | 7 |
3 files changed, 14 insertions, 3 deletions
diff --git a/ikvm/starter.cs b/ikvm/starter.cs index b35f5208..74c360cd 100644 --- a/ikvm/starter.cs +++ b/ikvm/starter.cs @@ -156,6 +156,10 @@ public class Starter { IKVM.Internal.Starter.ClassUnloading = false; } + else if(arg == "-Xverify") + { + IKVM.Internal.Starter.RelaxedVerification = false; + } else if(arg == "-jar") { jar = true; @@ -266,7 +270,6 @@ public class Starter || arg.StartsWith("-Xss") || arg == "-Xmixed" || arg == "-Xint" - || arg == "-Xnoclassgc" || arg == "-Xincgc" || arg == "-Xbatch" || arg == "-Xfuture" @@ -326,6 +329,7 @@ public class Starter Console.Error.WriteLine(" -Xbreak Trigger a user defined breakpoint at startup"); Console.Error.WriteLine(" -Xnoclassgc Disable class garbage collection"); Console.Error.WriteLine(" -Xnoglobbing Disable argument globbing"); + Console.Error.WriteLine(" -Xverify Enable strict class file verification"); return 1; } try diff --git a/runtime/ClassLoaderWrapper.cs b/runtime/ClassLoaderWrapper.cs index 8d149b65..13f23f06 100644 --- a/runtime/ClassLoaderWrapper.cs +++ b/runtime/ClassLoaderWrapper.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2010 Jeroen Frijters + Copyright (C) 2002-2011 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -278,7 +278,7 @@ namespace IKVM.Internal #if FIRST_PASS return true; #else - return javaClassLoader == null || java.lang.ClassLoader.isTrustedLoader(javaClassLoader); + return JVM.relaxedVerification && (javaClassLoader == null || java.lang.ClassLoader.isTrustedLoader(javaClassLoader)); #endif } } diff --git a/runtime/vm.cs b/runtime/vm.cs index 2e354c37..657502df 100644 --- a/runtime/vm.cs +++ b/runtime/vm.cs @@ -77,6 +77,12 @@ namespace IKVM.Internal set { } #endif } + + public static bool RelaxedVerification + { + get { return JVM.relaxedVerification; } + set { JVM.relaxedVerification = value; } + } } } #endif // !STATIC_COMPILER && !STUB_GENERATOR @@ -97,6 +103,7 @@ namespace IKVM.Internal #endif #endif // STATIC_COMPILER private static Assembly coreAssembly; + internal static bool relaxedVerification = true; internal static Version SafeGetAssemblyVersion(System.Reflection.Assembly asm) { |