[Mono-bugs] [Bug 76665][Cos] Changed - Missing CS0162, unreachable code detected

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Nov 11 04:21:35 EST 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by marek.safar at seznam.cz.

http://bugzilla.ximian.com/show_bug.cgi?id=76665

--- shadow/76665	2005-11-10 18:01:41.000000000 -0500
+++ shadow/76665.tmp.5872	2005-11-11 04:21:35.000000000 -0500
@@ -46,6 +46,34 @@
 Additional Information:
 
 ------- Additional Comments From miguel at ximian.com  2005-11-10 18:01 -------
 This kind of error will be extremely hard to track down and would
 involve a fairly large set of changes to the compiler that I do not
 think is worth putting in.
+
+------- Additional Comments From marek.safar at seznam.cz  2005-11-11 04:21 -------
+I hope it will not be so hard. I tried to fix it and this 2 lines
+patch almost works (ok does something ;-))
+
+Index: statement.cs
+===================================================================
+--- statement.cs	(revision 52897)
++++ statement.cs	(working copy)
+@@ -457,6 +457,11 @@
+ 			if (Increment != null){
+ 				if (!Increment.Resolve (ec))
+ 					ok = false;
++				
++				Block b = Statement as Block;
++				if (b != null && b.HasRet)
++					Report.Warning (162, 2, Increment.loc, "Unreachable code detected");
++				
+ 			}
+ 
+ 			ec.CurrentBranching.Infinite = infinite;
+
+
+However, there is 1 missing check; if the block contains reachable
+continue statement which has to been yet implemented.
+
+I think it is worthwhile because when I last tried it I found several
+'buggy' for cycles.


More information about the mono-bugs mailing list