2002-08-08 Martin Baulig <martin@gnome.org>
authorMartin Baulig <martin@novell.com>
Thu, 8 Aug 2002 20:26:50 +0000 (20:26 -0000)
committerMartin Baulig <martin@novell.com>
Thu, 8 Aug 2002 20:26:50 +0000 (20:26 -0000)
* driver.cs (Driver.MainDriver): Only report an error CS5001
if there were no compilation errors.

* codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
`UnsafeContext' property to determine whether the parent is in
unsafe context rather than checking the parent's ModFlags:
classes nested in an unsafe class are unsafe as well.

svn path=/trunk/mcs/; revision=6553

mcs/mcs/ChangeLog
mcs/mcs/codegen.cs
mcs/mcs/driver.cs

index 191f0758843b5d3d2e7bda31533f7390158e4a70..e83769108d6b8d0f52eb969645076948a7c0abbf 100755 (executable)
@@ -1,3 +1,13 @@
+2002-08-08  Martin Baulig  <martin@gnome.org>
+
+       * driver.cs (Driver.MainDriver): Only report an error CS5001
+       if there were no compilation errors.
+
+       * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
+       `UnsafeContext' property to determine whether the parent is in
+       unsafe context rather than checking the parent's ModFlags:
+       classes nested in an unsafe class are unsafe as well.
+
 2002-08-08  Martin Baulig  <martin@gnome.org>
 
        * statement.cs (UsageVector.MergeChildren): Distinguish between
index 19aa0c46dd27f3cf945bb06ad9cff894a200b80d..7fe97ba1ccde03d87ffd8917e5737a5789ae3c54 100755 (executable)
@@ -337,8 +337,11 @@ namespace Mono.CSharp {
                        
                        if (parent != null){
                                // Can only be null for the ResolveType contexts.
-                       ContainerType = parent.TypeBuilder;
-                       InUnsafe = ((parent.ModFlags | code_flags) & Modifiers.UNSAFE) != 0;
+                               ContainerType = parent.TypeBuilder;
+                               if (parent.UnsafeContext)
+                                       InUnsafe = true;
+                               else
+                                       InUnsafe = (code_flags & Modifiers.UNSAFE) != 0;
                        }
                        OnlyLookupTypes = false;
                        loc = l;
index 19607182a3dce2153e06ceb4b8a61827b7ead48e..a7f3209c2d6253fd5794343463d006424a5c19fc 100755 (executable)
@@ -1173,7 +1173,8 @@ namespace Mono.CSharp
                                MethodInfo ep = RootContext.EntryPoint;
 
                                if (ep == null){
-                                       Report.Error (5001, "Program " + output_file +
+                                       if (Report.Errors == 0)
+                                               Report.Error (5001, "Program " + output_file +
                                                              " does not have an entry point defined");
                                        return false;
                                }