Permalink
Browse files

In ilasm/codegen:

	* MethodDef.cs (MethodDef.AddLabel): Throw exception for duplicate
	labels.

In ilasm/errors:
	* err-dup-label.il: New.

svn path=/branches/mono-1-1-13/mcs/; revision=60460
  • Loading branch information...
1 parent f3c1074 commit e12df734e5637ea967ade30064c48e711c70d56e @radical radical committed May 9, 2006
Showing with 29 additions and 2 deletions.
  1. +5 −0 mcs/ilasm/codegen/ChangeLog
  2. +3 −2 mcs/ilasm/codegen/MethodDef.cs
  3. +4 −0 mcs/ilasm/errors/ChangeLog
  4. +17 −0 mcs/ilasm/errors/err-dup-label.il
View
5 mcs/ilasm/codegen/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-09 Ankit Jain <jankit@novell.com>
+
+ * MethodDef.cs (MethodDef.AddLabel): Throw exception for duplicate
+ labels.
+
2006-05-09 Ankit Jain <jankit@novell.com>
* CodeGen.cs (CodeGen.data_list): Change to ..
View
5 mcs/ilasm/codegen/MethodDef.cs
@@ -558,9 +558,10 @@ public LabelInfo AddLabel (string name)
{
LabelInfo label_info = (LabelInfo) label_table[name];
if (label_info != null)
- return label_info;
+ throw new ILAsmException ("Duplicate label: '{0}'" + name);
+
label_info = new LabelInfo (name, inst_list.Count);
- label_table.Add (name, label_info);
+ label_table [name] = label_info;
return label_info;
}
View
4 mcs/ilasm/errors/ChangeLog
@@ -1,5 +1,9 @@
2006-05-09 Ankit Jain <jankit@novell.com>
+ * err-dup-label.il: New.
+
+2006-05-09 Ankit Jain <jankit@novell.com>
+
* err-dup-datalabel.il: New.
2006-02-10 Ankit Jain <jankit@novell.com>
View
17 mcs/ilasm/errors/err-dup-label.il
@@ -0,0 +1,17 @@
+// Test for duplicate labels
+
+.assembly extern mscorlib { }
+
+.class public T {
+
+ .method public static void main ()
+ {
+ .entrypoint
+
+ IL_0001: ldstr "Hello"
+ IL_0001: call void [mscorlib]System.Console::WriteLine(string)
+ ret
+ }
+
+}
+

0 comments on commit e12df73

Please sign in to comment.