[Mono-bugs] [Bug 54987][Maj] Changed - MCS incorrectly handles "null" in switch() statement

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 1 Mar 2004 07:19:58 -0500 (EST)


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 iain@mccoy.id.au.

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

--- shadow/54987	2004-02-28 15:29:28.000000000 -0500
+++ shadow/54987.tmp.12552	2004-03-01 07:19:58.000000000 -0500
@@ -2,21 +2,20 @@
 Product: Mono/Compilers
 Version: unspecified
 OS: Fedora 1.0
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: jaak@zd.com.pl               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
-Cc: 
 Summary: MCS incorrectly handles "null" in switch() statement
 
 Description of Problem:
 
 MCS incorrectly compiles switch () statement on string types. 
 
@@ -53,6 +52,29 @@
 When compiled with csc.exe - it runs without a problem.
 
 ------- Additional Comments From jaak@zd.com.pl  2004-02-28 15:29 -------
 Created an attachment (id=6799)
 test case to reproduce this problem
 
+
+------- Additional Comments From iain@mccoy.id.au  2004-03-01 07:19 -------
+It seems that by rearranging the Test function in the attached test,
+we can actually get something correct:
+            case "postgres":
+            case "postgresql":
+                Console.WriteLine("PostgreSQL");
+                break;
+                                                                     
+          
+            case "msde":
+            case "mssql":
+            case "microsoft":
+            default:
+                Console.WriteLine("MS");
+                break;
+works, but it seems any combination that does not put the default:
+label at the bottom of the list will fail.
+
+I *think* the problem is in mcs/statement.cs, in the TableSwitchEmit
+function. I suspect that lblDefault is not getting it's value
+properly. I might throw a sack of print statements at the problem
+tomorrow.