X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fgmcs%2Fcodegen.cs;h=7f5d62efb21963cc23558a1e2ba0159949972416;hb=cffda3181a45b81bbf989a128da6f7a5047a6a99;hp=0bab8e95e1ce336fa79529239436d6815995e34e;hpb=a883b630bfe06753c768c7a2fe0304575eebc21e;p=mono.git diff --git a/mcs/gmcs/codegen.cs b/mcs/gmcs/codegen.cs old mode 100755 new mode 100644 index 0bab8e95e1c..7f5d62efb21 --- a/mcs/gmcs/codegen.cs +++ b/mcs/gmcs/codegen.cs @@ -88,7 +88,7 @@ namespace Mono.CSharp { // if (SymbolWriter == null) { Report.Warning ( - -18, "Could not find the symbol writer assembly (Mono.CSharp.Debugger.dll). This is normally an installation problem. Please make sure to compile and install the mcs/class/Mono.CSharp.Debugger directory."); + -18, "Could not find the symbol writer assembly (Mono.CompilerServices.SymbolWriter.dll). This is normally an installation problem. Please make sure to compile and install the mcs/class/Mono.CompilerServices.SymbolWriter directory."); return; } } @@ -435,6 +435,9 @@ namespace Mono.CSharp { DeclSpace = ds; CheckState = RootContext.Checked; ConstantCheckState = true; + + if ((return_type is TypeBuilder) && return_type.IsGenericTypeDefinition) + throw new Exception ("FUCK"); IsStatic = (code_flags & Modifiers.STATIC) != 0; InIterator = (code_flags & Modifiers.METHOD_YIELDS) != 0; @@ -1041,7 +1044,11 @@ namespace Mono.CSharp { if (OptAttributes == null) return null; - EmitContext temp_ec = new EmitContext (new RootTypes (), Mono.CSharp.Location.Null, null, null, 0, false); + // Ensure that we only have GlobalAttributes, since the Search below isn't safe with other types. + if (!OptAttributes.CheckTargets (this)) + return null; + + EmitContext temp_ec = new EmitContext (RootContext.Tree.Types, Mono.CSharp.Location.Null, null, null, 0, false); Attribute a = OptAttributes.Search (TypeManager.cls_compliant_attribute_type, temp_ec); if (a != null) { a.Resolve (temp_ec); @@ -1055,6 +1062,7 @@ namespace Mono.CSharp { public AssemblyBuilder Builder; bool is_cls_compliant; + public Attribute ClsCompliantAttribute; ListDictionary declarative_security; @@ -1084,11 +1092,11 @@ namespace Mono.CSharp { public void ResolveClsCompliance () { - Attribute a = GetClsCompliantAttribute (); - if (a == null) + ClsCompliantAttribute = GetClsCompliantAttribute (); + if (ClsCompliantAttribute == null) return; - is_cls_compliant = a.GetClsCompliantAttributeValue (null); + is_cls_compliant = ClsCompliantAttribute.GetClsCompliantAttributeValue (null); } // fix bug #56621 @@ -1322,13 +1330,20 @@ namespace Mono.CSharp { return; } - ApplyAttributeBuilder (null, new CustomAttributeBuilder (TypeManager.unverifiable_code_ctor, new object [0])); + Builder.SetCustomAttribute (new CustomAttributeBuilder (TypeManager.unverifiable_code_ctor, new object [0])); } public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder customBuilder) { - if (a != null && a.Type == TypeManager.cls_compliant_attribute_type) { - Report.Warning (3012, a.Location, "You must specify the CLSCompliant attribute on the assembly, not the module, to enable CLS compliance checking"); + if (a.Type == TypeManager.cls_compliant_attribute_type) { + if (CodeGen.Assembly.ClsCompliantAttribute == null) { + Report.Warning (3012, a.Location, "You must specify the CLSCompliant attribute on the assembly, not the module, to enable CLS compliance checking"); + } + else if (CodeGen.Assembly.IsClsCompliant != a.GetBoolean ()) { + Report.SymbolRelatedToPreviousError (CodeGen.Assembly.ClsCompliantAttribute.Location, CodeGen.Assembly.ClsCompliantAttribute.Name); + Report.Error (3017, a.Location, "You cannot specify the CLSCompliant attribute on a module that differs from the CLSCompliant attribute on the assembly"); + return; + } } Builder.SetCustomAttribute (customBuilder);