[Mono-devel-list] mcs generates incorrect IL-code using decla rations after goto

Hayes, Dennis Dennis.Hayes at raytek.com
Wed Jun 30 13:19:15 EDT 2004


> Why the heck would anybody want to do that?
I wonder that a lot.
It is still a good and valid test.
This is the kind of bug a good tester finds.

Only two things came out of Berkley, Unix and LSD.
Not a coincidence.

Dennis
-----Original Message-----
From: Friedrich Priewasser [mailto:priewasser at gmx.at]
Sent: Wednesday, June 30, 2004 10:12 AM
To: Mono-devel-list at lists.ximian.com
Subject: Re: [Mono-devel-list] mcs generates incorrect IL-code using
declarations after goto


> Why the heck would anybody want to do that? But anyway, it only happens  
> if you have actualy unreachable code. If you do a conditional goto like  
> the following:

Hi,

I don't know why the heck anyone should do that, I also don't kwnow why I  
tested this :-)
But you could use "a" after jumping to end (there is a unreachable code  
warning, but it works):

public class Test{
	public static void Main(){
		goto end;
		int a;
		end:
		a=5;
		System.Console.WriteLine(a);
	}
}

Works fine using csc (ok, it makes no sence using goto here too...)


friedl


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list