2009-09-02 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 2 Sep 2009 20:49:48 +0000 (20:49 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 2 Sep 2009 20:49:48 +0000 (20:49 -0000)
* ILGenerator.cs (label_fixup): Check for unmarked labels.
Fixes #536243.

svn path=/trunk/mcs/; revision=141176

mcs/class/corlib/System.Reflection.Emit/ChangeLog
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs

index 2a59ea5a9b865620b27ef0ba47db805f5bd42aa9..9bffb3c735da9bee88e9e56e01817761877704e6 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * ILGenerator.cs (label_fixup): Check for unmarked labels.
+       Fixes #536243.
+
 2009-08-06 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * MethodBuilder.cs: Mark generic_params internal.
index 2441f1c9f1263d11f5d6895874937d8e0bec3a44..26544d907eccbc79dfb693b38969c69ae90deddd 100644 (file)
@@ -1020,7 +1020,8 @@ namespace System.Reflection.Emit {
                internal void label_fixup ()
                {
                        for (int i = 0; i < num_fixups; ++i) {
-                               
+                               if (labels [fixups [i].label_idx].addr < 0)
+                                       throw new ArgumentException ("Label not marked");
                                // Diff is the offset from the end of the jump instruction to the address of the label
                                int diff = labels [fixups [i].label_idx].addr - (fixups [i].pos + fixups [i].offset);
                                if (fixups [i].offset == 1) {