Set svn:eol-style=native, delete svn:executable.
[mono.git] / mcs / class / corlib / System.Reflection.Emit / AssemblyBuilder.cs
old mode 100755 (executable)
new mode 100644 (file)
index 7befbff..deb5eee
@@ -105,6 +105,7 @@ namespace System.Reflection.Emit {
                private RefEmitPermissionSet[] permissions_refused;
                PortableExecutableKind peKind;
                ImageFileMachine machine;
+               bool corlib_internal;
                #endregion
                internal Type corlib_object_type = typeof (System.Object);
                internal Type corlib_value_type = typeof (System.ValueType);
@@ -119,13 +120,17 @@ namespace System.Reflection.Emit {
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern void basic_init (AssemblyBuilder ab);
                
-               internal AssemblyBuilder (AssemblyName n, string directory, AssemblyBuilderAccess access) {
+               internal AssemblyBuilder (AssemblyName n, string directory, AssemblyBuilderAccess access, bool corlib_internal)
+               {
                        name = n.Name;
-                       if (directory == null || directory == String.Empty)
+                       this.access = (uint)access;
+
+                       // don't call GetCurrentDirectory for Run-only builders (CAS may not like that)
+                       if (IsSave && (directory == null || directory == String.Empty)) {
                                dir = Directory.GetCurrentDirectory ();
-                       else
+                       } else {
                                dir = directory;
-                       this.access = (uint)access;
+                       }
 
                        /* Set defaults from n */
                        if (n.CultureInfo != null) {
@@ -148,6 +153,8 @@ namespace System.Reflection.Emit {
                                }
                        }
 
+                       this.corlib_internal = corlib_internal;
+
                        basic_init (this);
                }