[Mono-bugs] [Bug 78024][Nor] Changed - Thread.Abort() fails if 'return' is used inside 'catch'

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Apr 11 19:03:46 EDT 2006


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 vargaz at gmail.com.

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

--- shadow/78024	2006-04-10 22:08:24.000000000 -0400
+++ shadow/78024.tmp.2742	2006-04-11 19:03:46.000000000 -0400
@@ -58,6 +58,37 @@
 Created an attachment (id=16746)
 Simplified test case.
 
 
 ------- Additional Comments From gonzalo at ximian.com  2006-04-10 22:08 -------
 Compile and run the test. It should never print the "I'm still alive".
+
+------- Additional Comments From vargaz at gmail.com  2006-04-11 19:03 -------
+This seems to be a problem with the code generated by mcs:
+
+      .try { // 1
+          .try { // 0
+            IL_0000:  ldc.i4 3000
+            IL_0005:  call void class
+[mscorlib]System.Threading.Thread::Sleep(int32)
+            IL_000a:  leave IL_0036
+
+          } // end .try 0
+          catch [mscorlib]System.Exception { // 0
+            IL_000f:  stloc.0
+            IL_0010:  ldstr "Got exception: "
+            IL_0015:  ldloc.0
+            IL_0016:  callvirt instance string class
+[mscorlib]System.Exception::get_Message()
+            IL_001b:  call string string::Concat(string, string)
+            IL_0020:  stloc.1
+            IL_0021:  leave IL_003c
+
+            IL_0026:  leave IL_0036
+
+          } // end handler 0
+
+Notice that the catch block contains two 'leave' statements. 
+MS.NET and PEVerify seems to permit this, so I guess this means this
+is valid IL. It confuses the mono runtime, however. The csc compiled
+programs runs fine on mono.
+


More information about the mono-bugs mailing list