Permalink
Browse files

Merged 72684 from trunk

svn path=/branches/mono-1-2-3/mcs/; revision=72867
  • Loading branch information...
1 parent 191ed8d commit 6b2181df333da3201aa21e7aac7af0092a95f155 Wade Berrier committed Feb 14, 2007
Showing with 12 additions and 1 deletion.
  1. +2 −0 mcs/mcs/ChangeLog
  2. +10 −1 mcs/mcs/const.cs
View
@@ -6,6 +6,8 @@
* class.cs (DefineFieldInitializers): Each initializer can has different
resolve context.
+
+ * const.cs: Updated.
2007-01-27 Raja R Harinath <rharinath@novell.com>
View
@@ -76,6 +76,11 @@ public override bool Define ()
return false;
}
+ // If the constant is private then we don't need any field the
+ // value is already inlined and cannot be referenced
+ //if ((ModFlags & Modifiers.PRIVATE) != 0 && RootContext.Optimize)
+ // return true;
+
while (ttype.IsArray)
ttype = TypeManager.GetElementType (ttype);
@@ -91,7 +96,8 @@ public override bool Define ()
TypeManager.RegisterConstant (FieldBuilder, this);
if (ttype == TypeManager.decimal_type)
- Parent.PartialContainer.RegisterFieldForInitialization (this, new FieldInitializer (FieldBuilder, initializer));
+ Parent.PartialContainer.RegisterFieldForInitialization (this,
+ new FieldInitializer (FieldBuilder, initializer, Parent));
return true;
}
@@ -118,6 +124,9 @@ public override void Emit ()
if (!ResolveValue ())
return;
+ if (FieldBuilder == null)
+ return;
+
if (value.Type == TypeManager.decimal_type) {
Decimal d = ((DecimalConstant)value).Value;
int[] bits = Decimal.GetBits (d);

0 comments on commit 6b2181d

Please sign in to comment.