[Mono-bugs] [Bug 82627][Wis] New - [Mono-1.2.4]-gmcs-EnumTypeAndUsingStatementBug

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 29 11:00:06 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lei.min at gmx.de.

http://bugzilla.ximian.com/show_bug.cgi?id=82627

--- shadow/82627	2007-08-29 11:00:06.000000000 -0400
+++ shadow/82627.tmp.1114	2007-08-29 11:00:06.000000000 -0400
@@ -0,0 +1,107 @@
+Bug#: 82627
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: Windows with .net framework 2.0
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: lei.min at gmx.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [Mono-1.2.4]-gmcs-EnumTypeAndUsingStatementBug
+
+Description of Problem:
+i have by myself build the gmcs.exe under Visual C# 2005 Express Edition.
+the gmcs.exe hat three known bugs in the source. the bugs are:
+gmcs.exe can not compile C# source which includes enum type define,which
+has a usingstatement with var_declaration
+(for example: using(ClassA a=new ClassA());)
+i am trying myself to debug these. and found some changes, it can resolve
+these bugs. but i am not sure ,if those changes are correct.
+
+> mcs\typemanager.cs
+> //public static void AddUserType(DeclSpace ds)
+> //{
+> //+ if (ds is Enum)
+> //+ {
+> //+ ds.TypeBuilder = ds.DefineType();
+> //+ }
+> // builder_to_declspace.Add(ds.TypeBuilder, ds);
+> //} line 401,410 typemanager.cs patch for the Enum to remove:
+> // InvalidOperationException ("enum basetype is not defined");
+> //
+> mcs\ecore.cs
+> //public override object GetTypedValue ()
+> //{
+> // // FIXME: runtime is not ready to work with just emited enums
+> // if (!RootContext.StdLib) {
+> // return Child.GetValue ();
+> // }
+> //
+> //+ return Child.GetValue();
+> //- return System.Enum.ToObject (type, Child.GetValue ());
+> //} line 1538,1547 ecore.cs patch for the Enum to remove:
+> // ArgumentException ("enumType must be a runtime type");
+
+> mcs\statement.cs
+> //- if (emit_finally)
+> //-    ig.BeginFinallyBlock();
+> 
+> // line 4512,4516 statement.cs remove the ArgumentException in using
+statement, because
+> // ig.BeginFinallyBlock() has been called in the method
+DoEmitFinally(EmitContext) in the Class ExceptionStatement
+
+> //				if (emit_finally)
+> //					ig.BeginExceptionBlock ();
+> //				assign [i].Emit (ec);
+> //orignal is: 
+> //              assign [i].Emit (ec);
+> //
+> //				if (emit_finally)
+> //					ig.BeginExceptionBlock ();
+> //
+> // line 4490,4495  statement.cs assign[i].Emit should be after the
+BeginExceptionBlock,because assign has referenced the local variable
+> //  and it will call Dispose(); in the finallyblock, or we can in finally
+block generate a local copy for the variable.
+
+
+> //		protected override void CloneTo (CloneContext clonectx, Statement t)
+> //		{
+> //			Using target = (Using) t;
+> //
+> //			if (expression_or_block is Expression)
+> //				target.expression_or_block = ((Expression)
+expression_or_block).Clone (clonectx);
+> //			else
+> //-				target.expression_or_block = ((DictionaryEntry)
+expression_or_block).Clone (clonectx);
+> //+             target.expression_or_block = expression_or_block;
+> //			
+> //			target.Statement = Statement.Clone (clonectx);
+> //		}
+> // line 4670,4685 statement.cs
+
+
+
+here is another bug in the statement.cs ,but i can not change.
+> mcs\statement.cs
+> in Class Using:
+> // protected override void CloneTo (CloneContext clonectx, Statement t)
+> // {
+> // Using target = (Using) t;
+> // if (expression_or_block is Expression)
+> // target.expression_or_block =
+> ((Expression)expression_or_block).Clone(clonectx);
+> // else
+> // error--->> target.expression_or_block = ((Statement)
+> expression_or_block).Clone (clonectx);
+> // } line 4670,4685 expression_or_block is either a Expression or a
+> DictionaryEntry, not a Statement.


More information about the mono-bugs mailing list