* expression.cs (New.DoEmit): Create a new LocalTemporary each time
this function is called, it's not allowed to share LocalBuilders
among ILGenerators.
svn path=/trunk/mcs/; revision=5916
+2002-07-19 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (New.DoEmit): Create a new LocalTemporary each time
+ this function is called, it's not allowed to share LocalBuilders
+ among ILGenerators.
+
2002-07-19 Martin Baulig <martin@gnome.org>
* expression.cs (Argument.Resolve): Report an error 118 when trying
// we will not leave anything on the stack.
//
Expression value_target;
+ bool value_target_set = false;
public New (Expression requested_type, ArrayList arguments, Location l)
{
set {
value_target = value;
+ value_target_set = true;
}
}
if (is_value_type){
IMemoryLocation ml;
- if (value_target == null)
+ // Allow DoEmit() to be called multiple times.
+ // We need to create a new LocalTemporary each time since
+ // you can't share LocalBuilders among ILGeneators.
+ if (!value_target_set)
value_target = new LocalTemporary (ec, type);
ml = (IMemoryLocation) value_target;