[Mono-bugs] [Bug 78549][Wis] New - Null reference exception does not break flow correctly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed May 31 14:09:07 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 nazgul at omega.pl.

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

--- shadow/78549	2006-05-31 14:09:07.000000000 -0400
+++ shadow/78549.tmp.10960	2006-05-31 14:09:07.000000000 -0400
@@ -0,0 +1,109 @@
+Bug#: 78549
+Product: Mono: Runtime
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: nazgul at omega.pl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Null reference exception does not break flow correctly
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+The exception is thrown, but some of the code after it is being executed
+
+Steps to reproduce the problem:
+1. Compile following IL
+
+.assembly extern mscorlib
+{
+  .ver 2:0:0:0
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+}
+.assembly 'out'
+{
+  .custom instance void class
+[mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32)
+=  (01 00 08 00 00 00 00 00 ) // ........
+
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+.module 'out' // GUID = {4C258A12-8B71-4F2F-BBD4-D5D836DE4A15}
+
+
+  .class private auto ansi abstract sealed M
+        extends [mscorlib]System.Object
+  {
+
+    // method line 1
+    .method public static  hidebysig 
+           default void Main ()  cil managed 
+    {
+        // Method begins at RVA 0x20ec
+        .entrypoint
+        // Code size 99 (0x63)
+        .maxstack 10
+        .locals init (
+                string  V_0,
+                int32   V_1,
+                string  V_2,
+                class [mscorlib]System.NullReferenceException   V_3)
+        .try { // 0
+          IL_0000:  ldstr "output"
+          IL_0005:  stloc.0 
+          IL_0006:  ldnull 
+          IL_0007:  callvirt instance int32 string::get_Length()
+          IL_000c:  stloc.1 
+          IL_000d:  ldstr "!!"
+          IL_0012:  stloc.2 
+          IL_0013:  ldstr "this "
+          IL_0018:  call void class [mscorlib]System.Console::Write(string)
+          IL_001d:  ldloc.0 
+          IL_001e:  call void class [mscorlib]System.Console::Write(string)
+          IL_0023:  ldstr " will be "
+          IL_0028:  call void class [mscorlib]System.Console::Write(string)
+          IL_002d:  ldloc.1 
+          IL_002e:  call void class [mscorlib]System.Console::Write(int32)
+          IL_0033:  ldstr " interrupted "
+          IL_0038:  call void class [mscorlib]System.Console::Write(string)
+          IL_003d:  ldloc.2 
+          IL_003e:  call void class [mscorlib]System.Console::Write(string)
+          IL_0043:  ldstr "\n"
+          IL_0048:  call void class [mscorlib]System.Console::Write(string)
+          IL_004d:  leave IL_0062
+
+        } // end .try 0
+        catch [mscorlib]System.NullReferenceException { // 0
+          IL_0052:  stloc.3 
+          IL_0053:  ldstr "ok-catched\n"
+          IL_0058:  call void class [mscorlib]System.Console::Write(string)
+          IL_005d:  leave IL_0062
+
+        } // end handler 0
+        IL_0062:  ret 
+    } // end of method M::default void Main () 
+
+  } // end of class M
+
+
+Actual Results:
+this output will be ok-catched
+
+Expected Results:
+ok-catched
+
+How often does this happen? 
+with current mono svn always
+
+Additional Information:
+it works fine with mono 1.1.15


More information about the mono-bugs mailing list