[Mono-bugs] [Bug 76550][Nor] Changed - [PATCH] ParameterReference.Emit does not handle leave_copy

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Nov 11 02:28:31 EST 2005


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 bmaurer at users.sf.net.

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

--- shadow/76550	2005-11-11 02:08:00.000000000 -0500
+++ shadow/76550.tmp.4220	2005-11-11 02:28:31.000000000 -0500
@@ -104,6 +104,45 @@
 
 ------- Additional Comments From miguel at ximian.com  2005-11-11 02:07 -------
 Is there a reason to pass "ref LocalTemporary" around everywhere?
 
 It seems like it can be completely local to the routine that consumes
 it.  What am I missing
+
+------- Additional Comments From bmaurer at users.sf.net  2005-11-11 02:28 -------
+Emit and EmitAssign must share a local variable: it is not enough to
+do clever manipulations with the stack using dup to pass the
+information between the two routines.
+
+In LocalVariableReference (which is very similar to this code), we
+have the LocalTemporary as an instance variable. However, that's not
+an option here, the closest we can get is passing it by ref. The other
+(probably cleaner) way to do it is to refactor this to look more like
+the local code. However, this may require more knowledge of the
+anonymous code than I have.
+
+One example where you need to use a local temporary in both methods is
+y++ where y is captured. The code path is:
+
+		this.EmitAssign (ec, source, false, true)
+			<load context>
+			dup
+			
+			Binary.Emit ()
+				this.Emit (ec, true);
+				ldfld y
+				dup
+				stloc temp
+				end this.Emit (ec, true);
+				
+				IntConstant.Emit ()
+				ldc.i4.1
+				end IntConstant.Emit
+				
+				add
+			end Binary.Emit ()
+			
+			stfld
+			ldloc temp
+		end this.EmitAssign (ec, source, false, true)
+
+Note how both Emit and EmitAssign need to use that temporary variable.


More information about the mono-bugs mailing list