[Mono-list] Bug 72149

Sohail Somani sohail@taggedtype.net
Thu, 03 Feb 2005 10:11:49 -0800


Hi,

If .locals init (...) has duplicate symbols, mono ilasm croaks because
it assumes symbols are unique.

.NET doesnt because it basically seems to ignore symbols and work on
stack slots. 

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

I have attached a test case that can be used for regression (and
demonstrate the problem). The patch:

Index: codegen/MethodDef.cs
===================================================================
--- codegen/MethodDef.cs	(revision 39963)
+++ codegen/MethodDef.cs	(working copy)
@@ -183,7 +183,8 @@
                                 slot_pos++;
                                 if (local.Name == null)
                                         continue;
-                                named_local_table.Add (local.Name, local);
+				if(!named_local_table.Contains(local.Name))
+				  named_local_table.Add (local.Name, local);
                         }
 
                         this.local_list.AddRange (local_list);

only comes into effect in the case that there are already duplicate
symbols. In other cases, its business as usual

Thank you kind sirs

WHAT UP B-DOG!