[Mono-bugs] [Bug 54473][Wis] Changed - String of len > 64 not interned

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 17 Feb 2004 22:27:24 -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 bmaurer@users.sf.net.

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

--- shadow/54473	2004-02-17 22:22:47.000000000 -0500
+++ shadow/54473.tmp.19611	2004-02-17 22:27:23.000000000 -0500
@@ -10,14 +10,13 @@
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: ndhameja@panaceasoftware.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
-Cc: 
-Summary: string in case statement cannot > 64 chars
+Summary: String of len > 64 not interned
 
 In case statements, the maximum length of the string is 64 bytes. That is,
 
 <-------------------------------------------------------------->
  strName = "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}
 partnerLinks";
@@ -39,6 +38,41 @@
  Maybe it would be a better idea to make the string length the same as 
 microsoft .Net.
 
 ------- Additional Comments From bmaurer@users.sf.net  2004-02-17 22:22 -------
 Compiling on MCS and running on MS.net does not work. CSC generates
 almost identical code to MCS, and fails on Mono. So this is a runtime bug.
+
+------- Additional Comments From bmaurer@users.sf.net  2004-02-17 22:27 -------
+Ok, this is a simpler test case:
+
+using System;
+
+class T {
+	const string s =
+"{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks";
+	static void Main () {
+		System.Console.WriteLine (object.ReferenceEquals (string.IsInterned
+(s), s));
+	}
+}
+
+Prints `false' on mono, `true' on MS.
+
+It appears that the string `s' is not being interned here.
+
+The IL code looks like:
+
+        IL_0000:  ldstr
+"{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks"
+        IL_0005:  call string valuetype
+[mscorlib]'System.String'::'IsInterned'(string)
+        IL_000a:  ldstr
+"{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks"
+        IL_000f:  call bool valuetype
+[mscorlib]'System.Object'::'ReferenceEquals'(object, object)
+        IL_0014:  call void class
+[mscorlib]'System.Console'::'WriteLine'(bool)
+        IL_0019:  ret
+
+In IL_0000, the string is loaded on to the stack. So, at the time of
+the String::IsInterened call at IL_0005, the string must be interned.