Skip to content

Commit

Permalink
Fix output of local variable names in debugging symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
jbevain committed Jan 10, 2011
1 parent 666d378 commit 262e680
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions mcs/ilasm/codegen/MethodDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,13 @@ public int GetNamedParamPos (string name)

public LocalVariableEntry[] GetLocalVars()
{
System.IO.MemoryStream str = new System.IO.MemoryStream();
int i = 0;
int num_locals = ((Hashtable) named_local_tables [current_scope_depth]).Count;
LocalVariableEntry[] locals = new LocalVariableEntry[num_locals];

ArrayList named_locals = new ArrayList ();
foreach (Local local in local_list) {
if (local.Name != null) { // only named variables
locals[i++] = new LocalVariableEntry(local.Slot, local.Name, 0);
named_locals.Add (new LocalVariableEntry(local.Slot, local.Name, 0));
}
}
return locals;
return (LocalVariableEntry []) named_locals.ToArray (typeof (LocalVariableEntry));
}


Expand Down

2 comments on commit 262e680

@alexrp
Copy link
Contributor

@alexrp alexrp commented on 262e680 Mar 21, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@migueldeicaza
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, backported this to 2.10

Please sign in to comment.