diff options
author | jfrijters <jfrijters> | 2015-02-16 14:09:00 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2015-02-18 13:43:23 +0300 |
commit | 1fb7c0933e0a1ee7a4b253d87ce3c6e3ff32dfed (patch) | |
tree | 576c9a3b8557e6afc5c196036c1baaf590fe5038 | |
parent | 953e93d187e746050051cd1662c3622621952d60 (diff) |
Bug fix. When -Xsave is used the modopt types should be attached to unloadable types in inherited method signatures.
-rw-r--r-- | runtime/DynamicTypeWrapper.cs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/runtime/DynamicTypeWrapper.cs b/runtime/DynamicTypeWrapper.cs index cf2c5cd0..daf2d5d2 100644 --- a/runtime/DynamicTypeWrapper.cs +++ b/runtime/DynamicTypeWrapper.cs @@ -1442,14 +1442,6 @@ namespace IKVM.Internal private static void CheckLoaderConstraints(MethodWrapper mw, MethodWrapper baseMethod) { -#if !STATIC_COMPILER - if (JVM.FinishingForDebugSave) - { - // when we're finishing types to save a debug image (in dynamic mode) we don't care about loader constraints anymore - // (and we can't throw a LinkageError, because that would prevent the debug image from being saved) - return; - } -#endif if (mw.ReturnType != baseMethod.ReturnType) { if (mw.ReturnType.IsUnloadable || baseMethod.ReturnType.IsUnloadable) @@ -1464,8 +1456,14 @@ namespace IKVM.Internal { #if STATIC_COMPILER StaticCompiler.LinkageError("Method \"{2}.{3}{4}\" has a return type \"{0}\" and tries to override method \"{5}.{3}{4}\" that has a return type \"{1}\"", mw.ReturnType, baseMethod.ReturnType, mw.DeclaringType.Name, mw.Name, mw.Signature, baseMethod.DeclaringType.Name); +#else + // when we're finishing types to save a debug image (in dynamic mode) we don't care about loader constraints anymore + // (and we can't throw a LinkageError, because that would prevent the debug image from being saved) + if (!JVM.FinishingForDebugSave) + { + throw new LinkageError("Loader constraints violated"); + } #endif - throw new LinkageError("Loader constraints violated"); } } TypeWrapper[] here = mw.GetParameters(); @@ -1486,8 +1484,14 @@ namespace IKVM.Internal { #if STATIC_COMPILER StaticCompiler.LinkageError("Method \"{2}.{3}{4}\" has an argument type \"{0}\" and tries to override method \"{5}.{3}{4}\" that has an argument type \"{1}\"", here[i], there[i], mw.DeclaringType.Name, mw.Name, mw.Signature, baseMethod.DeclaringType.Name); +#else + // when we're finishing types to save a debug image (in dynamic mode) we don't care about loader constraints anymore + // (and we can't throw a LinkageError, because that would prevent the debug image from being saved) + if (!JVM.FinishingForDebugSave) + { + throw new LinkageError("Loader constraints violated"); + } #endif - throw new LinkageError("Loader constraints violated"); } } } |