[Mono-bugs] [Bug 40839][Cri] Changed - MCS emits invalid IL code

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 7 Apr 2003 02:33:00 -0400 (EDT)


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 miguel@ximian.com.

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

--- shadow/40839	Mon Apr  7 00:55:48 2003
+++ shadow/40839.tmp.31672	Mon Apr  7 02:33:00 2003
@@ -1,13 +1,13 @@
 Bug#: 40839
 Product: Mono/MCS
 Version: unspecified
 OS: All
 OS Details: 
-Status: NEW   
-Resolution: 
+Status: RESOLVED   
+Resolution: FIXED
 Severity: Unknown
 Priority: Critical
 Component: Misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
@@ -53,6 +53,33 @@
 		}
 
 	}
 }
 
 The code leaves a value on the stack, but the stack should be empty.
+
+------- Additional Comments From miguel@ximian.com  2003-04-07 02:32 -------
+The bug was that in EmitAssign, when we cached the values from a
+computation, we did not continue the flow:
+
+This is the new code:
+
+		public void EmitAssign (EmitContext ec, Expression source)
+		{
+			if (temporary != null){
+				if (have_temporary)
+					temporary.Emit (ec);
+				else {
+					expr.Emit (ec);
+					ec.ig.Emit (OpCodes.Dup);
+					temporary.Store (ec);
+					have_temporary = true;
+				}
+			} else
+				expr.Emit (ec);
+
+			source.Emit (ec);
+			StoreFromPtr (ec.ig, type);
+		}
+
+Before we had a `return' after `temporary.Emit (ec)', which caused the
+output to be incorrect.  The fix is being commited.