if (ilgen == null || ilgen.ILOffset == 0)
throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
- ilgen.label_fixup ();
+ ilgen.label_fixup (this);
// Have to create all DynamicMethods referenced by this one
try {
throw new NotImplementedException ();
}
- internal void label_fixup ()
+ internal void label_fixup (MethodBase mb)
{
for (int i = 0; i < num_fixups; ++i) {
if (labels [fixups [i].label_idx].addr < 0)
- throw new ArgumentException ("Label not marked");
+ throw new ArgumentException (string.Format ("Label #{0} is not marked in method `{1}'", fixups [i].label_idx + 1, mb.Name));
// 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) {