s = "extern"; break;
case Modifiers.VOLATILE:
s = "volatile"; break;
+ case Modifiers.UNSAFE:
+ s = "unsafe"; break;
}
return s;
// If we do not have static constructors, static methods
// can be invoked without initializing the type.
- if (!caller.HaveStaticConstructor)
+ if (!caller.UserDefinedStaticConstructor &&
+ (caller.Kind != Kind.Interface))
t |= TypeAttributes.BeforeFieldInit;
return t;
public static MethodAttributes MethodAttr (int mod_flags)
{
- MethodAttributes ma = 0;
+ MethodAttributes ma = MethodAttributes.HideBySig;
if ((mod_flags & PUBLIC) != 0)
ma |= MethodAttributes.Public;
if ((mod_flags & STATIC) != 0)
ma |= MethodAttributes.Static;
if ((mod_flags & ABSTRACT) != 0){
- ma |= MethodAttributes.Abstract | MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
+ ma |= MethodAttributes.Abstract | MethodAttributes.Virtual;
}
if ((mod_flags & SEALED) != 0)
ma |= MethodAttributes.Final;
ma |= MethodAttributes.Virtual;
if ((mod_flags & OVERRIDE) != 0)
- ma |= MethodAttributes.Virtual | MethodAttributes.HideBySig;
+ ma |= MethodAttributes.Virtual;
else {
if ((ma & MethodAttributes.Virtual) != 0)
ma |= MethodAttributes.NewSlot;
}
- if ((mod_flags & NEW) != 0)
- ma |= MethodAttributes.HideBySig;
-
return ma;
}
if ((mod & Modifiers.UNSAFE) != 0){
if (!RootContext.Unsafe){
Report.Error (227, l,
- "Unsafe code requires the --unsafe command " +
+ "Unsafe code requires the -unsafe command " +
"line option to be specified");
}
}
return mod;
}
- for (i = 1; i < TOP; i <<= 1){
+ for (i = 1; i <= TOP; i <<= 1){
if ((i & invalid_flags) == 0)
continue;