[Mono-devel-list] Re: [Mono-patches] r37791 - trunk/mcs/mcs

Ben Maurer bmaurer at ximian.com
Wed Dec 15 12:28:16 EST 2004


> Modified: trunk/mcs/mcs/ChangeLog
> =================================================================== ---
> trunk/mcs/mcs/ChangeLog	2004-12-15 17:01:15 UTC (rev 37790)
> +++ trunk/mcs/mcs/ChangeLog	2004-12-15 17:15:12 UTC (rev 37791)
> @@ -1,3 +1,7 @@
> +2004-12-15  Marek Safar  <marek.safar at seznam.cz>
> +
> +	* cs-parser.jay: Don't create a block for every variable.
> +
>  2004-12-14  Miguel de Icaza  <miguel at ximian.com>
>
>  	* location.cs: Provide extra information.
>
> Modified: trunk/mcs/mcs/cs-parser.jay
> =================================================================== ---
> trunk/mcs/mcs/cs-parser.jay	2004-12-15 17:01:15 UTC (rev 37790) +++
> trunk/mcs/mcs/cs-parser.jay	2004-12-15 17:15:12 UTC (rev 37791) @@
> -4528,10 +4528,7 @@
>  	//
>  	// int j = 1;  int k = j + 1;
>  	//
> -	if (current_block.Used)
> -		implicit_block = new Block (current_block, Block.Flags.Implicit, loc,
> Location.Null); -	else
> -		implicit_block = current_block;
> +	implicit_block = current_block;

This is incorrect. It will allow:

int k = j;
int j = 1;

To compile (well, it will likely get a flow control error, but that will
be the wrong error. The correct error is that the variable `j' is not in
scope at `k', not that `j' is unassigned.

-- Ben





More information about the Mono-devel-list mailing list